instana-client 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- instana_client/__init__.py +534 -0
- instana_client/api/__init__.py +58 -0
- instana_client/api/action_catalog_api.py +1380 -0
- instana_client/api/action_history_api.py +1793 -0
- instana_client/api/apdex_report_api.py +338 -0
- instana_client/api/apdex_settings_api.py +1353 -0
- instana_client/api/api_token_api.py +1370 -0
- instana_client/api/application_alert_configuration_api.py +2865 -0
- instana_client/api/application_analyze_api.py +2017 -0
- instana_client/api/application_catalog_api.py +885 -0
- instana_client/api/application_metrics_api.py +1211 -0
- instana_client/api/application_resources_api.py +1487 -0
- instana_client/api/application_settings_api.py +7261 -0
- instana_client/api/application_topology_api.py +354 -0
- instana_client/api/audit_log_api.py +635 -0
- instana_client/api/authentication_api.py +1008 -0
- instana_client/api/business_monitoring_api.py +2177 -0
- instana_client/api/custom_dashboards_api.py +1930 -0
- instana_client/api/event_settings_api.py +14613 -0
- instana_client/api/events_api.py +1654 -0
- instana_client/api/global_application_alert_configuration_api.py +2606 -0
- instana_client/api/groups_api.py +4078 -0
- instana_client/api/health_api.py +527 -0
- instana_client/api/host_agent_api.py +2120 -0
- instana_client/api/infrastructure_alert_configuration_api.py +2524 -0
- instana_client/api/infrastructure_analyze_api.py +1141 -0
- instana_client/api/infrastructure_catalog_api.py +1822 -0
- instana_client/api/infrastructure_metrics_api.py +331 -0
- instana_client/api/infrastructure_resources_api.py +1880 -0
- instana_client/api/infrastructure_topology_api.py +595 -0
- instana_client/api/log_alert_configuration_api.py +2524 -0
- instana_client/api/maintenance_configuration_api.py +2683 -0
- instana_client/api/mobile_app_analyze_api.py +613 -0
- instana_client/api/mobile_app_catalog_api.py +825 -0
- instana_client/api/mobile_app_configuration_api.py +2847 -0
- instana_client/api/mobile_app_metrics_api.py +892 -0
- instana_client/api/policies_api.py +1755 -0
- instana_client/api/releases_api.py +1408 -0
- instana_client/api/service_levels_alert_configuration_api.py +2577 -0
- instana_client/api/service_levels_objective_slo_configurations_api.py +1825 -0
- instana_client/api/service_levels_objective_slo_report_api.py +335 -0
- instana_client/api/session_settings_api.py +801 -0
- instana_client/api/sli_report_api.py +352 -0
- instana_client/api/sli_settings_api.py +2677 -0
- instana_client/api/synthetic_alert_configuration_api.py +2606 -0
- instana_client/api/synthetic_calls_api.py +789 -0
- instana_client/api/synthetic_catalog_api.py +543 -0
- instana_client/api/synthetic_metrics_api.py +322 -0
- instana_client/api/synthetic_settings_api.py +5144 -0
- instana_client/api/synthetic_test_playback_results_api.py +2142 -0
- instana_client/api/usage_api.py +1404 -0
- instana_client/api/user_api.py +2404 -0
- instana_client/api/website_analyze_api.py +619 -0
- instana_client/api/website_catalog_api.py +832 -0
- instana_client/api/website_configuration_api.py +3745 -0
- instana_client/api/website_metrics_api.py +889 -0
- instana_client/api_client.py +798 -0
- instana_client/api_response.py +21 -0
- instana_client/configuration.py +616 -0
- instana_client/exceptions.py +217 -0
- instana_client/models/__init__.py +464 -0
- instana_client/models/abstract_integration.py +155 -0
- instana_client/models/abstract_rule.py +124 -0
- instana_client/models/access_log_entry.py +105 -0
- instana_client/models/access_log_response.py +98 -0
- instana_client/models/access_rule.py +107 -0
- instana_client/models/action.py +135 -0
- instana_client/models/action_configuration.py +104 -0
- instana_client/models/action_instance.py +185 -0
- instana_client/models/action_instance_metadata_entry.py +90 -0
- instana_client/models/action_instance_parameter.py +94 -0
- instana_client/models/action_instance_request.py +108 -0
- instana_client/models/action_instance_request_parameters.py +92 -0
- instana_client/models/action_match.py +98 -0
- instana_client/models/action_search_space.py +94 -0
- instana_client/models/adaptive_baseline.py +92 -0
- instana_client/models/adaptive_threshold_rule.py +91 -0
- instana_client/models/adjusted_timeframe.py +91 -0
- instana_client/models/agent_configuration_update.py +93 -0
- instana_client/models/alerting_configuration.py +113 -0
- instana_client/models/alerting_configuration_with_last_updated.py +115 -0
- instana_client/models/alerting_time_window.py +109 -0
- instana_client/models/apdex_configuration.py +99 -0
- instana_client/models/apdex_configuration_input.py +95 -0
- instana_client/models/apdex_entity.py +119 -0
- instana_client/models/apdex_report.py +94 -0
- instana_client/models/api_create_group.py +104 -0
- instana_client/models/api_group.py +107 -0
- instana_client/models/api_member.py +90 -0
- instana_client/models/api_permission_set.py +178 -0
- instana_client/models/api_restricted_application_filter.py +108 -0
- instana_client/models/api_token.py +250 -0
- instana_client/models/app_data_metric_configuration.py +105 -0
- instana_client/models/application.py +104 -0
- instana_client/models/application_alert_config.py +203 -0
- instana_client/models/application_alert_config_with_metadata.py +213 -0
- instana_client/models/application_alert_rule.py +135 -0
- instana_client/models/application_apdex_entity.py +111 -0
- instana_client/models/application_config.py +131 -0
- instana_client/models/application_event_result.py +108 -0
- instana_client/models/application_item.py +94 -0
- instana_client/models/application_metric_result.py +109 -0
- instana_client/models/application_node.py +106 -0
- instana_client/models/application_result.py +102 -0
- instana_client/models/application_scope.py +89 -0
- instana_client/models/application_scope_with_metadata.py +90 -0
- instana_client/models/application_sli_entity.py +103 -0
- instana_client/models/application_slo_entity.py +112 -0
- instana_client/models/application_time_threshold.py +115 -0
- instana_client/models/audit_log_entry.py +102 -0
- instana_client/models/audit_log_ui_response.py +98 -0
- instana_client/models/author.py +100 -0
- instana_client/models/availability_blueprint_indicator.py +106 -0
- instana_client/models/availability_sli_entity.py +138 -0
- instana_client/models/available_metrics.py +96 -0
- instana_client/models/available_plugins.py +88 -0
- instana_client/models/backend_trace_reference.py +88 -0
- instana_client/models/binary_operator_dto.py +107 -0
- instana_client/models/browser_script_configuration.py +127 -0
- instana_client/models/built_in_event_specification.py +123 -0
- instana_client/models/built_in_event_specification_with_last_updated.py +125 -0
- instana_client/models/business_activity.py +132 -0
- instana_client/models/business_perspective_config.py +99 -0
- instana_client/models/call_groups_item.py +95 -0
- instana_client/models/call_groups_result.py +111 -0
- instana_client/models/call_relation.py +100 -0
- instana_client/models/change_summary.py +101 -0
- instana_client/models/cloudfoundry_physical_context.py +104 -0
- instana_client/models/condition.py +88 -0
- instana_client/models/config_version.py +101 -0
- instana_client/models/crash_mobile_app_alert_rule.py +90 -0
- instana_client/models/cursor_paginated_business_activity_item.py +96 -0
- instana_client/models/cursor_pagination.py +93 -0
- instana_client/models/cursor_pagination_infra_explore_cursor.py +90 -0
- instana_client/models/custom_blueprint_indicator.py +104 -0
- instana_client/models/custom_dashboard.py +111 -0
- instana_client/models/custom_dashboard_preview.py +103 -0
- instana_client/models/custom_email_subject_prefix.py +94 -0
- instana_client/models/custom_event_mobile_app_alert_rule.py +92 -0
- instana_client/models/custom_event_specification.py +133 -0
- instana_client/models/custom_event_specification_with_last_updated.py +143 -0
- instana_client/models/custom_event_website_alert_rule.py +92 -0
- instana_client/models/custom_payload_configuration.py +97 -0
- instana_client/models/custom_payload_field.py +112 -0
- instana_client/models/custom_payload_with_last_updated.py +99 -0
- instana_client/models/dashboard_api_token.py +90 -0
- instana_client/models/database_integration.py +90 -0
- instana_client/models/deprecated_tag_filter.py +111 -0
- instana_client/models/dns_action_configuration.py +134 -0
- instana_client/models/dns_action_filter_query_time.py +99 -0
- instana_client/models/dns_action_filter_target_value.py +106 -0
- instana_client/models/duration.py +98 -0
- instana_client/models/dynamic_field.py +95 -0
- instana_client/models/dynamic_field_value.py +90 -0
- instana_client/models/dynamic_parameter.py +94 -0
- instana_client/models/edit_user.py +88 -0
- instana_client/models/email_integration.py +98 -0
- instana_client/models/empty_configuration.py +92 -0
- instana_client/models/endpoint.py +131 -0
- instana_client/models/endpoint_config.py +112 -0
- instana_client/models/endpoint_event_result.py +112 -0
- instana_client/models/endpoint_item.py +94 -0
- instana_client/models/endpoint_metric_result.py +109 -0
- instana_client/models/endpoint_node.py +91 -0
- instana_client/models/endpoint_result.py +102 -0
- instana_client/models/endpoint_simple.py +102 -0
- instana_client/models/entity_count_rule.py +100 -0
- instana_client/models/entity_count_verification_rule.py +114 -0
- instana_client/models/entity_health_info.py +99 -0
- instana_client/models/entity_id.py +92 -0
- instana_client/models/entity_verification_rule.py +105 -0
- instana_client/models/error_budget_alert_rule.py +97 -0
- instana_client/models/errors_application_alert_rule.py +90 -0
- instana_client/models/event.py +127 -0
- instana_client/models/event_filtering_configuration.py +106 -0
- instana_client/models/event_result.py +145 -0
- instana_client/models/event_specification_info.py +114 -0
- instana_client/models/extended_service.py +123 -0
- instana_client/models/failure_synthetic_alert_rule.py +90 -0
- instana_client/models/fixed_http_path_segment_matching_rule.py +90 -0
- instana_client/models/fixed_time_window.py +93 -0
- instana_client/models/full_trace.py +97 -0
- instana_client/models/generic_infra_alert_rule.py +93 -0
- instana_client/models/geo_location_configuration.py +106 -0
- instana_client/models/geo_mapping_rule.py +120 -0
- instana_client/models/geo_subdivision.py +91 -0
- instana_client/models/get_activities.py +115 -0
- instana_client/models/get_application_metrics.py +112 -0
- instana_client/models/get_applications.py +150 -0
- instana_client/models/get_available_metrics_query.py +103 -0
- instana_client/models/get_available_plugins_query.py +98 -0
- instana_client/models/get_call_groups.py +141 -0
- instana_client/models/get_combined_metrics.py +103 -0
- instana_client/models/get_dynamic_parameter_values.py +100 -0
- instana_client/models/get_endpoints.py +150 -0
- instana_client/models/get_infrastructure_groups_query.py +127 -0
- instana_client/models/get_infrastructure_query.py +127 -0
- instana_client/models/get_metrics_result.py +128 -0
- instana_client/models/get_mobile_app_beacon_groups.py +146 -0
- instana_client/models/get_mobile_app_beacons.py +118 -0
- instana_client/models/get_mobile_app_metrics.py +122 -0
- instana_client/models/get_mobile_app_metrics_v2.py +118 -0
- instana_client/models/get_payload_keys_result.py +88 -0
- instana_client/models/get_services.py +147 -0
- instana_client/models/get_snapshots_query.py +95 -0
- instana_client/models/get_test_result.py +139 -0
- instana_client/models/get_test_result_base.py +120 -0
- instana_client/models/get_test_result_list.py +125 -0
- instana_client/models/get_test_summary_result.py +130 -0
- instana_client/models/get_trace_download_result_item.py +114 -0
- instana_client/models/get_trace_groups.py +141 -0
- instana_client/models/get_traces.py +125 -0
- instana_client/models/get_website_beacon_groups.py +146 -0
- instana_client/models/get_website_beacons.py +118 -0
- instana_client/models/get_website_metrics.py +122 -0
- instana_client/models/get_website_metrics_v2.py +118 -0
- instana_client/models/global_application_alert_config_with_metadata.py +205 -0
- instana_client/models/global_applications_alert_config.py +191 -0
- instana_client/models/google_chat_integration.py +92 -0
- instana_client/models/graph_edge.py +102 -0
- instana_client/models/graph_node.py +100 -0
- instana_client/models/group.py +100 -0
- instana_client/models/group_by_tag.py +90 -0
- instana_client/models/group_mapping.py +95 -0
- instana_client/models/health_state.py +100 -0
- instana_client/models/historic_baseline.py +105 -0
- instana_client/models/host_availability_rule.py +100 -0
- instana_client/models/http_action_configuration.py +127 -0
- instana_client/models/http_endpoint_config.py +103 -0
- instana_client/models/http_endpoint_rule.py +101 -0
- instana_client/models/http_path_segment_matching_rule.py +124 -0
- instana_client/models/http_script_configuration.py +113 -0
- instana_client/models/hyper_param.py +111 -0
- instana_client/models/identity_provider_patch.py +88 -0
- instana_client/models/infra_alert_config.py +166 -0
- instana_client/models/infra_alert_config_with_metadata.py +176 -0
- instana_client/models/infra_alert_rule.py +133 -0
- instana_client/models/infra_event_result.py +109 -0
- instana_client/models/infra_metric_configuration.py +115 -0
- instana_client/models/infra_time_threshold.py +109 -0
- instana_client/models/infrastructure_entities_result.py +109 -0
- instana_client/models/infrastructure_group.py +92 -0
- instana_client/models/infrastructure_groups_result.py +109 -0
- instana_client/models/infrastructure_item.py +104 -0
- instana_client/models/infrastructure_metric_result.py +96 -0
- instana_client/models/instana_version_info.py +92 -0
- instana_client/models/integration_overview.py +94 -0
- instana_client/models/invitation.py +94 -0
- instana_client/models/invitation_response.py +96 -0
- instana_client/models/invitation_result.py +100 -0
- instana_client/models/ip_masking_configuration.py +95 -0
- instana_client/models/js_stack_trace_line.py +99 -0
- instana_client/models/kubernetes_physical_context.py +107 -0
- instana_client/models/latency_blueprint_indicator.py +106 -0
- instana_client/models/location_status.py +96 -0
- instana_client/models/log_alert_config.py +154 -0
- instana_client/models/log_alert_config_with_metadata.py +164 -0
- instana_client/models/log_alert_rule.py +120 -0
- instana_client/models/log_count_alert_rule.py +90 -0
- instana_client/models/log_entry_actor.py +101 -0
- instana_client/models/log_event_result.py +107 -0
- instana_client/models/log_time_threshold.py +109 -0
- instana_client/models/logs_application_alert_rule.py +122 -0
- instana_client/models/maintenance_config.py +103 -0
- instana_client/models/maintenance_config_scheduling.py +118 -0
- instana_client/models/maintenance_config_v2.py +111 -0
- instana_client/models/maintenance_config_v2_with_state_and_occurrence.py +131 -0
- instana_client/models/maintenance_config_with_last_updated.py +105 -0
- instana_client/models/maintenance_window.py +93 -0
- instana_client/models/manual_alerting_channel_configuration.py +99 -0
- instana_client/models/manual_close_info.py +99 -0
- instana_client/models/manual_service_config.py +103 -0
- instana_client/models/match_all_http_path_segment_matching_rule.py +88 -0
- instana_client/models/match_expression_dto.py +111 -0
- instana_client/models/meta_data.py +96 -0
- instana_client/models/metric_api_result.py +94 -0
- instana_client/models/metric_config.py +99 -0
- instana_client/models/metric_configuration.py +103 -0
- instana_client/models/metric_description.py +116 -0
- instana_client/models/metric_instance.py +105 -0
- instana_client/models/metric_item.py +102 -0
- instana_client/models/metric_metadata.py +132 -0
- instana_client/models/metric_pattern.py +101 -0
- instana_client/models/metrics_result.py +96 -0
- instana_client/models/metrics_result_item.py +100 -0
- instana_client/models/metrics_test_result_item.py +102 -0
- instana_client/models/mobile_app.py +91 -0
- instana_client/models/mobile_app_alert_config.py +162 -0
- instana_client/models/mobile_app_alert_rule.py +129 -0
- instana_client/models/mobile_app_beacon_groups_item.py +95 -0
- instana_client/models/mobile_app_beacon_groups_result.py +111 -0
- instana_client/models/mobile_app_beacon_result.py +111 -0
- instana_client/models/mobile_app_beacon_tag_group.py +100 -0
- instana_client/models/mobile_app_beacons_item.py +94 -0
- instana_client/models/mobile_app_event_result.py +108 -0
- instana_client/models/mobile_app_metric_result.py +88 -0
- instana_client/models/mobile_app_monitoring_beacon.py +259 -0
- instana_client/models/mobile_app_monitoring_metric_description.py +123 -0
- instana_client/models/mobile_app_monitoring_metrics_configuration.py +105 -0
- instana_client/models/mobile_app_time_threshold.py +115 -0
- instana_client/models/model_field.py +96 -0
- instana_client/models/monitoring_state.py +92 -0
- instana_client/models/multiple_scripts_configuration.py +90 -0
- instana_client/models/new_application_config.py +129 -0
- instana_client/models/new_business_perspective_config.py +97 -0
- instana_client/models/new_manual_service_config.py +100 -0
- instana_client/models/occurrence.py +91 -0
- instana_client/models/office365_integration.py +92 -0
- instana_client/models/one_time_maintenance_window.py +94 -0
- instana_client/models/opsgenie_integration.py +105 -0
- instana_client/models/order.py +99 -0
- instana_client/models/pagerduty_integration.py +92 -0
- instana_client/models/paginated_result.py +95 -0
- instana_client/models/pagination.py +91 -0
- instana_client/models/parameter.py +102 -0
- instana_client/models/parameter_value.py +90 -0
- instana_client/models/path_parameter_http_path_segment_matching_rule.py +90 -0
- instana_client/models/physical_context.py +119 -0
- instana_client/models/plugin_result.py +90 -0
- instana_client/models/policy.py +113 -0
- instana_client/models/policy_runnable.py +103 -0
- instana_client/models/post_snapshots_result.py +98 -0
- instana_client/models/problem.py +95 -0
- instana_client/models/prometheus_webhook_integration.py +94 -0
- instana_client/models/recurrent_maintenance_window.py +98 -0
- instana_client/models/release.py +111 -0
- instana_client/models/release_scope.py +94 -0
- instana_client/models/release_with_metadata.py +125 -0
- instana_client/models/rolling_time_window.py +90 -0
- instana_client/models/rule_input.py +98 -0
- instana_client/models/rule_with_threshold_application_alert_rule.py +116 -0
- instana_client/models/rule_with_threshold_infra_alert_rule.py +116 -0
- instana_client/models/rule_with_threshold_log_alert_rule.py +116 -0
- instana_client/models/rule_with_threshold_mobile_app_alert_rule.py +116 -0
- instana_client/models/rule_with_threshold_website_alert_rule.py +116 -0
- instana_client/models/run_configuration.py +96 -0
- instana_client/models/salesforce_integration.py +98 -0
- instana_client/models/scope_binding.py +91 -0
- instana_client/models/search_field_result.py +116 -0
- instana_client/models/service.py +116 -0
- instana_client/models/service_config.py +107 -0
- instana_client/models/service_event_result.py +110 -0
- instana_client/models/service_item.py +94 -0
- instana_client/models/service_level_indicator.py +172 -0
- instana_client/models/service_level_objective_alert_rule.py +100 -0
- instana_client/models/service_level_objective_configuration.py +118 -0
- instana_client/models/service_levels_alert_config.py +133 -0
- instana_client/models/service_levels_alert_rule.py +111 -0
- instana_client/models/service_levels_burn_rate_time_windows.py +97 -0
- instana_client/models/service_levels_time_threshold.py +90 -0
- instana_client/models/service_levelse_alert_config_with_metadata.py +143 -0
- instana_client/models/service_map.py +106 -0
- instana_client/models/service_map_connection.py +97 -0
- instana_client/models/service_matching_rule.py +90 -0
- instana_client/models/service_metric_result.py +109 -0
- instana_client/models/service_node.py +106 -0
- instana_client/models/service_now_enhanced_integration.py +116 -0
- instana_client/models/service_now_integration.py +98 -0
- instana_client/models/service_result.py +102 -0
- instana_client/models/service_scope.py +95 -0
- instana_client/models/service_scope_with_metadata.py +96 -0
- instana_client/models/service_scoped_to.py +97 -0
- instana_client/models/service_scoped_to_with_metadata.py +97 -0
- instana_client/models/service_simple.py +90 -0
- instana_client/models/session_settings.py +91 -0
- instana_client/models/slack_integration.py +98 -0
- instana_client/models/sli_configuration.py +105 -0
- instana_client/models/sli_configuration_with_last_updated.py +107 -0
- instana_client/models/sli_entity.py +117 -0
- instana_client/models/sli_report.py +100 -0
- instana_client/models/slo_entity.py +119 -0
- instana_client/models/slo_report.py +112 -0
- instana_client/models/slowness_application_alert_rule.py +90 -0
- instana_client/models/slowness_website_alert_rule.py +90 -0
- instana_client/models/snapshot_item.py +102 -0
- instana_client/models/snapshot_preview.py +97 -0
- instana_client/models/snapshot_result.py +96 -0
- instana_client/models/software_user.py +94 -0
- instana_client/models/software_version.py +124 -0
- instana_client/models/source_map_file_blob.py +92 -0
- instana_client/models/source_map_file_meta.py +115 -0
- instana_client/models/source_map_upload_config.py +106 -0
- instana_client/models/span.py +156 -0
- instana_client/models/span_excerpt.py +132 -0
- instana_client/models/span_relation.py +114 -0
- instana_client/models/specific_js_errors_website_alert_rule.py +101 -0
- instana_client/models/splunk_integration.py +94 -0
- instana_client/models/ssl_certificate_configuration.py +99 -0
- instana_client/models/stack_trace_item.py +92 -0
- instana_client/models/stack_trace_line.py +99 -0
- instana_client/models/static_baseline_threshold_rule.py +102 -0
- instana_client/models/static_string_field.py +91 -0
- instana_client/models/static_threshold.py +94 -0
- instana_client/models/static_threshold_rule.py +91 -0
- instana_client/models/status_code_application_alert_rule.py +95 -0
- instana_client/models/status_code_mobile_app_alert_rule.py +101 -0
- instana_client/models/status_code_website_alert_rule.py +101 -0
- instana_client/models/synthetic_alert_config.py +127 -0
- instana_client/models/synthetic_alert_config_with_metadata.py +137 -0
- instana_client/models/synthetic_alert_rule.py +120 -0
- instana_client/models/synthetic_call_config.py +99 -0
- instana_client/models/synthetic_call_rule.py +99 -0
- instana_client/models/synthetic_call_with_defaults_config.py +108 -0
- instana_client/models/synthetic_credential.py +111 -0
- instana_client/models/synthetic_datacenter.py +117 -0
- instana_client/models/synthetic_datacenter_configuration.py +88 -0
- instana_client/models/synthetic_geo_point.py +94 -0
- instana_client/models/synthetic_location.py +129 -0
- instana_client/models/synthetic_location_configuration.py +102 -0
- instana_client/models/synthetic_metric_configuration.py +99 -0
- instana_client/models/synthetic_metric_tag_group.py +100 -0
- instana_client/models/synthetic_playback_capabilities.py +98 -0
- instana_client/models/synthetic_slo_entity.py +95 -0
- instana_client/models/synthetic_test.py +149 -0
- instana_client/models/synthetic_time_threshold.py +110 -0
- instana_client/models/synthetic_type_configuration.py +141 -0
- instana_client/models/synthetics_event_result.py +110 -0
- instana_client/models/system_rule.py +91 -0
- instana_client/models/system_rule_label.py +90 -0
- instana_client/models/tag.py +123 -0
- instana_client/models/tag_catalog.py +106 -0
- instana_client/models/tag_filter.py +113 -0
- instana_client/models/tag_filter_expression.py +106 -0
- instana_client/models/tag_filter_expression_element.py +111 -0
- instana_client/models/tag_matcher_dto.py +110 -0
- instana_client/models/tag_tree_level.py +109 -0
- instana_client/models/tag_tree_node.py +113 -0
- instana_client/models/tag_tree_tag.py +103 -0
- instana_client/models/test_common_properties.py +136 -0
- instana_client/models/test_result.py +105 -0
- instana_client/models/test_result_common_properties.py +108 -0
- instana_client/models/test_result_detail_data.py +112 -0
- instana_client/models/test_result_item.py +106 -0
- instana_client/models/test_result_list_item.py +94 -0
- instana_client/models/test_result_list_result.py +103 -0
- instana_client/models/test_result_metadata.py +94 -0
- instana_client/models/test_result_subtransaction.py +90 -0
- instana_client/models/threshold.py +122 -0
- instana_client/models/threshold_config_rule.py +114 -0
- instana_client/models/threshold_rule.py +125 -0
- instana_client/models/throughput_application_alert_rule.py +90 -0
- instana_client/models/throughput_mobile_app_alert_rule.py +90 -0
- instana_client/models/throughput_website_alert_rule.py +90 -0
- instana_client/models/time_frame.py +91 -0
- instana_client/models/time_window.py +120 -0
- instana_client/models/topology.py +106 -0
- instana_client/models/trace.py +109 -0
- instana_client/models/trace_activity_tree_node_details.py +139 -0
- instana_client/models/trace_download_result.py +111 -0
- instana_client/models/trace_groups_item.py +95 -0
- instana_client/models/trace_groups_result.py +111 -0
- instana_client/models/trace_impact_application_time_threshold.py +92 -0
- instana_client/models/trace_item.py +94 -0
- instana_client/models/trace_result.py +111 -0
- instana_client/models/traffic_blueprint_indicator.py +104 -0
- instana_client/models/trigger.py +99 -0
- instana_client/models/type_configuration.py +107 -0
- instana_client/models/unsupported_http_path_segment_matching_rule.py +90 -0
- instana_client/models/updated_business_perspective_config.py +97 -0
- instana_client/models/usage_result.py +98 -0
- instana_client/models/usage_result_items.py +90 -0
- instana_client/models/user_basic_result.py +92 -0
- instana_client/models/user_impact_mobile_app_time_threshold.py +103 -0
- instana_client/models/user_impact_website_time_threshold.py +103 -0
- instana_client/models/user_result.py +98 -0
- instana_client/models/users_result.py +106 -0
- instana_client/models/validated_alerting_channel_input_info.py +123 -0
- instana_client/models/validated_alerting_configuration.py +121 -0
- instana_client/models/validated_maintenance_config_v2_with_state_and_occurrence.py +135 -0
- instana_client/models/validated_maintenance_config_with_status.py +116 -0
- instana_client/models/victor_ops_integration.py +94 -0
- instana_client/models/violations_in_period_application_time_threshold.py +92 -0
- instana_client/models/violations_in_period_mobile_app_time_threshold.py +92 -0
- instana_client/models/violations_in_period_website_time_threshold.py +92 -0
- instana_client/models/violations_in_sequence_application_time_threshold.py +89 -0
- instana_client/models/violations_in_sequence_infra_time_threshold.py +89 -0
- instana_client/models/violations_in_sequence_log_time_threshold.py +89 -0
- instana_client/models/violations_in_sequence_mobile_app_time_threshold.py +89 -0
- instana_client/models/violations_in_sequence_synthetic_time_threshold.py +89 -0
- instana_client/models/violations_in_sequence_website_time_threshold.py +89 -0
- instana_client/models/watson_ai_ops_webhook_integration.py +94 -0
- instana_client/models/webex_teams_webhook_integration.py +92 -0
- instana_client/models/webhook_integration.py +94 -0
- instana_client/models/webpage_action_configuration.py +109 -0
- instana_client/models/webpage_script_configuration.py +109 -0
- instana_client/models/website.py +92 -0
- instana_client/models/website_alert_config.py +166 -0
- instana_client/models/website_alert_config_with_metadata.py +176 -0
- instana_client/models/website_alert_rule.py +132 -0
- instana_client/models/website_apdex_entity.py +107 -0
- instana_client/models/website_beacon_groups_item.py +95 -0
- instana_client/models/website_beacon_groups_result.py +111 -0
- instana_client/models/website_beacon_result.py +111 -0
- instana_client/models/website_beacon_tag_group.py +100 -0
- instana_client/models/website_beacons_item.py +94 -0
- instana_client/models/website_event_based_sli_entity.py +110 -0
- instana_client/models/website_event_result.py +108 -0
- instana_client/models/website_metric_result.py +88 -0
- instana_client/models/website_monitoring_beacon.py +301 -0
- instana_client/models/website_monitoring_metric_description.py +123 -0
- instana_client/models/website_monitoring_metrics_configuration.py +99 -0
- instana_client/models/website_slo_entity.py +104 -0
- instana_client/models/website_time_based_sli_entity.py +105 -0
- instana_client/models/website_time_threshold.py +115 -0
- instana_client/models/widget.py +103 -0
- instana_client/models/with_metadata.py +172 -0
- instana_client/models/with_resolved_name.py +102 -0
- instana_client/models/z_chat_ops_integration.py +97 -0
- instana_client/py.typed +0 -0
- instana_client/rest.py +258 -0
- instana_client-1.0.0.dist-info/METADATA +25 -0
- instana_client-1.0.0.dist-info/RECORD +515 -0
- instana_client-1.0.0.dist-info/WHEEL +5 -0
- instana_client-1.0.0.dist-info/licenses/LICENSE +202 -0
- instana_client-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""API response object."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from typing import Optional, Generic, Mapping, TypeVar
|
|
5
|
+
from pydantic import Field, StrictInt, StrictBytes, BaseModel
|
|
6
|
+
|
|
7
|
+
T = TypeVar("T")
|
|
8
|
+
|
|
9
|
+
class ApiResponse(BaseModel, Generic[T]):
|
|
10
|
+
"""
|
|
11
|
+
API response object
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
status_code: StrictInt = Field(description="HTTP status code")
|
|
15
|
+
headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers")
|
|
16
|
+
data: T = Field(description="Deserialized data given the data type")
|
|
17
|
+
raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
|
|
18
|
+
|
|
19
|
+
model_config = {
|
|
20
|
+
"arbitrary_types_allowed": True
|
|
21
|
+
}
|
|
@@ -0,0 +1,616 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Instana REST API documentation
|
|
5
|
+
|
|
6
|
+
Searching for answers and best pratices? Check our [IBM Instana Community](https://community.ibm.com/community/user/aiops/communities/community-home?CommunityKey=58f324a3-3104-41be-9510-5b7c413cc48f). ## Overview The Instana REST API provides programmatic access to the Instana platform. It can be used to retrieve data available through the Instana UI Dashboard -- metrics, events, traces, etc -- and also to automate configuration tasks such as user management. ### Navigating the API documentation The API endpoints are grouped by product area and functionality. This generally maps to how our UI Dashboard is organized, hopefully making it easier to locate which endpoints you'd use to fetch the data you see visualized in our UI. The [UI sections](https://www.ibm.com/docs/en/instana-observability/current?topic=working-user-interface#navigation-menu) include: - Websites & Mobile Apps - Applications - Infrastructure - Synthetic Monitoring - Events - Automation - Service Levels - Settings - etc ### Rate Limiting A rate limit is applied to API usage. Up to 5,000 calls per hour can be made. How many remaining calls can be made and when this call limit resets, can inspected via three headers that are part of the responses of the API server. - **X-RateLimit-Limit:** Shows the maximum number of calls that may be executed per hour. - **X-RateLimit-Remaining:** How many calls may still be executed within the current hour. - **X-RateLimit-Reset:** Time when the remaining calls will be reset to the limit. For compatibility reasons with other rate limited APIs, this date is not the date in milliseconds, but instead in seconds since 1970-01-01T00:00:00+00:00. ### Further Reading We provide additional documentation for our REST API in our [product documentation](https://www.ibm.com/docs/en/instana-observability/current?topic=apis-web-rest-api). Here you'll also find some common queries for retrieving data and configuring Instana. ## Getting Started with the REST API ### API base URL The base URL for an specific instance of Instana can be determined using the tenant and unit information. - `base`: This is the base URL of a tenant unit, e.g. `https://test-example.instana.io`. This is the same URL that is used to access the Instana user interface. - `apiToken`: Requests against the Instana API require valid API tokens. An initial API token can be generated via the Instana user interface. Any additional API tokens can be generated via the API itself. ### Curl Example Here is an Example to use the REST API with Curl. First lets get all the available metrics with possible aggregations with a GET call. ```bash curl --request GET \\ --url https://test-instana.instana.io/api/application-monitoring/catalog/metrics \\ --header 'authorization: apiToken xxxxxxxxxxxxxxxx' ``` Next we can get every call grouped by the endpoint name that has an error count greater then zero. As a metric we could get the mean error rate for example. ```bash curl --request POST \\ --url https://test-instana.instana.io/api/application-monitoring/analyze/call-groups \\ --header 'authorization: apiToken xxxxxxxxxxxxxxxx' \\ --header 'content-type: application/json' \\ --data '{ \"group\":{ \"groupbyTag\":\"endpoint.name\" }, \"tagFilters\":[ { \"name\":\"call.error.count\", \"value\":\"0\", \"operator\":\"GREATER_THAN\" } ], \"metrics\":[ { \"metric\":\"errors\", \"aggregation\":\"MEAN\" } ] }' ``` ### Generating REST API clients The API is specified using the [OpenAPI v3](https://github.com/OAI/OpenAPI-Specification) (previously known as Swagger) format. You can download the current specification at our [GitHub API documentation](https://instana.github.io/openapi/openapi.yaml). OpenAPI tries to solve the issue of ever-evolving APIs and clients lagging behind. Please make sure that you always use the latest version of the generator, as a number of improvements are regularly made. To generate a client library for your language, you can use the [OpenAPI client generators](https://github.com/OpenAPITools/openapi-generator). #### Go For example, to generate a client library for Go to interact with our backend, you can use the following script; mind replacing the values of the `UNIT_NAME` and `TENANT_NAME` environment variables using those for your tenant unit: ```bash #!/bin/bash ### This script assumes you have the `java` and `wget` commands on the path export UNIT_NAME='myunit' # for example: prod export TENANT_NAME='mytenant' # for example: awesomecompany //Download the generator to your current working directory: wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.3.1/openapi-generator-cli-4.3.1.jar -O openapi-generator-cli.jar --server-variables \"tenant=${TENANT_NAME},unit=${UNIT_NAME}\" //generate a client library that you can vendor into your repository java -jar openapi-generator-cli.jar generate -i https://instana.github.io/openapi/openapi.yaml -g go \\ -o pkg/instana/openapi \\ --skip-validate-spec //(optional) format the Go code according to the Go code standard gofmt -s -w pkg/instana/openapi ``` The generated clients contain comprehensive READMEs, and you can start right away using the client from the example above: ```go import instana \"./pkg/instana/openapi\" // readTags will read all available application monitoring tags along with their type and category func readTags() { configuration := instana.NewConfiguration() configuration.Host = \"tenant-unit.instana.io\" configuration.BasePath = \"https://tenant-unit.instana.io\" client := instana.NewAPIClient(configuration) auth := context.WithValue(context.Background(), instana.ContextAPIKey, instana.APIKey{ Key: apiKey, Prefix: \"apiToken\", }) tags, _, err := client.ApplicationCatalogApi.GetApplicationTagCatalog(auth) if err != nil { fmt.Fatalf(\"Error calling the API, aborting.\") } for _, tag := range tags { fmt.Printf(\"%s (%s): %s\\n\", tag.Category, tag.Type, tag.Name) } } ``` #### Java Follow the instructions provided in the official documentation from [OpenAPI Tools](https://github.com/OpenAPITools) to download the [openapi-generator-cli.jar](https://github.com/OpenAPITools/openapi-generator?tab=readme-ov-file#13---download-jar). Depending on your environment, use one of the following java http client implementations which will create a valid client for our OpenAPI specification: ``` //Nativ Java HTTP Client java -jar openapi-generator-cli.jar generate -i https://instana.github.io/openapi/openapi.yaml -g java -o pkg/instana/openapi --skip-validate-spec -p dateLibrary=java8 --library native //Spring WebClient java -jar openapi-generator-cli.jar generate -i https://instana.github.io/openapi/openapi.yaml -g java -o pkg/instana/openapi --skip-validate-spec -p dateLibrary=java8,hideGenerationTimestamp=true --library webclient //Spring RestTemplate java -jar openapi-generator-cli.jar generate -i https://instana.github.io/openapi/openapi.yaml -g java -o pkg/instana/openapi --skip-validate-spec -p dateLibrary=java8,hideGenerationTimestamp=true --library resttemplate ```
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.291.1002
|
|
9
|
+
Contact: support@instana.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import copy
|
|
17
|
+
import http.client as httplib
|
|
18
|
+
import logging
|
|
19
|
+
from logging import FileHandler
|
|
20
|
+
import multiprocessing
|
|
21
|
+
import sys
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict
|
|
23
|
+
from typing_extensions import NotRequired, Self
|
|
24
|
+
|
|
25
|
+
import urllib3
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
JSON_SCHEMA_VALIDATION_KEYWORDS = {
|
|
29
|
+
'multipleOf', 'maximum', 'exclusiveMaximum',
|
|
30
|
+
'minimum', 'exclusiveMinimum', 'maxLength',
|
|
31
|
+
'minLength', 'pattern', 'maxItems', 'minItems'
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
ServerVariablesT = Dict[str, str]
|
|
35
|
+
|
|
36
|
+
GenericAuthSetting = TypedDict(
|
|
37
|
+
"GenericAuthSetting",
|
|
38
|
+
{
|
|
39
|
+
"type": str,
|
|
40
|
+
"in": str,
|
|
41
|
+
"key": str,
|
|
42
|
+
"value": str,
|
|
43
|
+
},
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
OAuth2AuthSetting = TypedDict(
|
|
48
|
+
"OAuth2AuthSetting",
|
|
49
|
+
{
|
|
50
|
+
"type": Literal["oauth2"],
|
|
51
|
+
"in": Literal["header"],
|
|
52
|
+
"key": Literal["Authorization"],
|
|
53
|
+
"value": str,
|
|
54
|
+
},
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
APIKeyAuthSetting = TypedDict(
|
|
59
|
+
"APIKeyAuthSetting",
|
|
60
|
+
{
|
|
61
|
+
"type": Literal["api_key"],
|
|
62
|
+
"in": str,
|
|
63
|
+
"key": str,
|
|
64
|
+
"value": Optional[str],
|
|
65
|
+
},
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
BasicAuthSetting = TypedDict(
|
|
70
|
+
"BasicAuthSetting",
|
|
71
|
+
{
|
|
72
|
+
"type": Literal["basic"],
|
|
73
|
+
"in": Literal["header"],
|
|
74
|
+
"key": Literal["Authorization"],
|
|
75
|
+
"value": Optional[str],
|
|
76
|
+
},
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
BearerFormatAuthSetting = TypedDict(
|
|
81
|
+
"BearerFormatAuthSetting",
|
|
82
|
+
{
|
|
83
|
+
"type": Literal["bearer"],
|
|
84
|
+
"in": Literal["header"],
|
|
85
|
+
"format": Literal["JWT"],
|
|
86
|
+
"key": Literal["Authorization"],
|
|
87
|
+
"value": str,
|
|
88
|
+
},
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
BearerAuthSetting = TypedDict(
|
|
93
|
+
"BearerAuthSetting",
|
|
94
|
+
{
|
|
95
|
+
"type": Literal["bearer"],
|
|
96
|
+
"in": Literal["header"],
|
|
97
|
+
"key": Literal["Authorization"],
|
|
98
|
+
"value": str,
|
|
99
|
+
},
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
HTTPSignatureAuthSetting = TypedDict(
|
|
104
|
+
"HTTPSignatureAuthSetting",
|
|
105
|
+
{
|
|
106
|
+
"type": Literal["http-signature"],
|
|
107
|
+
"in": Literal["header"],
|
|
108
|
+
"key": Literal["Authorization"],
|
|
109
|
+
"value": None,
|
|
110
|
+
},
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
AuthSettings = TypedDict(
|
|
115
|
+
"AuthSettings",
|
|
116
|
+
{
|
|
117
|
+
"ApiKeyAuth": APIKeyAuthSetting,
|
|
118
|
+
},
|
|
119
|
+
total=False,
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class HostSettingVariable(TypedDict):
|
|
124
|
+
description: str
|
|
125
|
+
default_value: str
|
|
126
|
+
enum_values: List[str]
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
class HostSetting(TypedDict):
|
|
130
|
+
url: str
|
|
131
|
+
description: str
|
|
132
|
+
variables: NotRequired[Dict[str, HostSettingVariable]]
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
class Configuration:
|
|
136
|
+
"""This class contains various settings of the API client.
|
|
137
|
+
|
|
138
|
+
:param host: Base url.
|
|
139
|
+
:param ignore_operation_servers
|
|
140
|
+
Boolean to ignore operation servers for the API client.
|
|
141
|
+
Config will use `host` as the base url regardless of the operation servers.
|
|
142
|
+
:param api_key: Dict to store API key(s).
|
|
143
|
+
Each entry in the dict specifies an API key.
|
|
144
|
+
The dict key is the name of the security scheme in the OAS specification.
|
|
145
|
+
The dict value is the API key secret.
|
|
146
|
+
:param api_key_prefix: Dict to store API prefix (e.g. Bearer).
|
|
147
|
+
The dict key is the name of the security scheme in the OAS specification.
|
|
148
|
+
The dict value is an API key prefix when generating the auth data.
|
|
149
|
+
:param username: Username for HTTP basic authentication.
|
|
150
|
+
:param password: Password for HTTP basic authentication.
|
|
151
|
+
:param access_token: Access token.
|
|
152
|
+
:param server_index: Index to servers configuration.
|
|
153
|
+
:param server_variables: Mapping with string values to replace variables in
|
|
154
|
+
templated server configuration. The validation of enums is performed for
|
|
155
|
+
variables with defined enum values before.
|
|
156
|
+
:param server_operation_index: Mapping from operation ID to an index to server
|
|
157
|
+
configuration.
|
|
158
|
+
:param server_operation_variables: Mapping from operation ID to a mapping with
|
|
159
|
+
string values to replace variables in templated server configuration.
|
|
160
|
+
The validation of enums is performed for variables with defined enum
|
|
161
|
+
values before.
|
|
162
|
+
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
|
163
|
+
in PEM format.
|
|
164
|
+
:param retries: Number of retries for API requests.
|
|
165
|
+
|
|
166
|
+
:Example:
|
|
167
|
+
|
|
168
|
+
API Key Authentication Example.
|
|
169
|
+
Given the following security scheme in the OpenAPI specification:
|
|
170
|
+
components:
|
|
171
|
+
securitySchemes:
|
|
172
|
+
cookieAuth: # name for the security scheme
|
|
173
|
+
type: apiKey
|
|
174
|
+
in: cookie
|
|
175
|
+
name: JSESSIONID # cookie name
|
|
176
|
+
|
|
177
|
+
You can programmatically set the cookie:
|
|
178
|
+
|
|
179
|
+
conf = instana_client.Configuration(
|
|
180
|
+
api_key={'cookieAuth': 'abc123'}
|
|
181
|
+
api_key_prefix={'cookieAuth': 'JSESSIONID'}
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
The following cookie will be added to the HTTP request:
|
|
185
|
+
Cookie: JSESSIONID abc123
|
|
186
|
+
"""
|
|
187
|
+
|
|
188
|
+
_default: ClassVar[Optional[Self]] = None
|
|
189
|
+
|
|
190
|
+
def __init__(
|
|
191
|
+
self,
|
|
192
|
+
host: Optional[str]=None,
|
|
193
|
+
api_key: Optional[Dict[str, str]]=None,
|
|
194
|
+
api_key_prefix: Optional[Dict[str, str]]=None,
|
|
195
|
+
username: Optional[str]=None,
|
|
196
|
+
password: Optional[str]=None,
|
|
197
|
+
access_token: Optional[str]=None,
|
|
198
|
+
server_index: Optional[int]=None,
|
|
199
|
+
server_variables: Optional[ServerVariablesT]=None,
|
|
200
|
+
server_operation_index: Optional[Dict[int, int]]=None,
|
|
201
|
+
server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
|
|
202
|
+
ignore_operation_servers: bool=False,
|
|
203
|
+
ssl_ca_cert: Optional[str]=None,
|
|
204
|
+
retries: Optional[int] = None,
|
|
205
|
+
*,
|
|
206
|
+
debug: Optional[bool] = None,
|
|
207
|
+
) -> None:
|
|
208
|
+
"""Constructor
|
|
209
|
+
"""
|
|
210
|
+
self._base_path = "https://unit-tenant.instana.io" if host is None else host
|
|
211
|
+
"""Default Base url
|
|
212
|
+
"""
|
|
213
|
+
self.server_index = 0 if server_index is None and host is None else server_index
|
|
214
|
+
self.server_operation_index = server_operation_index or {}
|
|
215
|
+
"""Default server index
|
|
216
|
+
"""
|
|
217
|
+
self.server_variables = server_variables or {}
|
|
218
|
+
self.server_operation_variables = server_operation_variables or {}
|
|
219
|
+
"""Default server variables
|
|
220
|
+
"""
|
|
221
|
+
self.ignore_operation_servers = ignore_operation_servers
|
|
222
|
+
"""Ignore operation servers
|
|
223
|
+
"""
|
|
224
|
+
self.temp_folder_path = None
|
|
225
|
+
"""Temp file folder for downloading files
|
|
226
|
+
"""
|
|
227
|
+
# Authentication Settings
|
|
228
|
+
self.api_key = {}
|
|
229
|
+
if api_key:
|
|
230
|
+
self.api_key = api_key
|
|
231
|
+
"""dict to store API key(s)
|
|
232
|
+
"""
|
|
233
|
+
self.api_key_prefix = {}
|
|
234
|
+
if api_key_prefix:
|
|
235
|
+
self.api_key_prefix = api_key_prefix
|
|
236
|
+
"""dict to store API prefix (e.g. Bearer)
|
|
237
|
+
"""
|
|
238
|
+
self.refresh_api_key_hook = None
|
|
239
|
+
"""function hook to refresh API key if expired
|
|
240
|
+
"""
|
|
241
|
+
self.username = username
|
|
242
|
+
"""Username for HTTP basic authentication
|
|
243
|
+
"""
|
|
244
|
+
self.password = password
|
|
245
|
+
"""Password for HTTP basic authentication
|
|
246
|
+
"""
|
|
247
|
+
self.access_token = access_token
|
|
248
|
+
"""Access token
|
|
249
|
+
"""
|
|
250
|
+
self.logger = {}
|
|
251
|
+
"""Logging Settings
|
|
252
|
+
"""
|
|
253
|
+
self.logger["package_logger"] = logging.getLogger("instana_client")
|
|
254
|
+
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
|
|
255
|
+
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
|
|
256
|
+
"""Log format
|
|
257
|
+
"""
|
|
258
|
+
self.logger_stream_handler = None
|
|
259
|
+
"""Log stream handler
|
|
260
|
+
"""
|
|
261
|
+
self.logger_file_handler: Optional[FileHandler] = None
|
|
262
|
+
"""Log file handler
|
|
263
|
+
"""
|
|
264
|
+
self.logger_file = None
|
|
265
|
+
"""Debug file location
|
|
266
|
+
"""
|
|
267
|
+
if debug is not None:
|
|
268
|
+
self.debug = debug
|
|
269
|
+
else:
|
|
270
|
+
self.__debug = False
|
|
271
|
+
"""Debug switch
|
|
272
|
+
"""
|
|
273
|
+
|
|
274
|
+
self.verify_ssl = True
|
|
275
|
+
"""SSL/TLS verification
|
|
276
|
+
Set this to false to skip verifying SSL certificate when calling API
|
|
277
|
+
from https server.
|
|
278
|
+
"""
|
|
279
|
+
self.ssl_ca_cert = ssl_ca_cert
|
|
280
|
+
"""Set this to customize the certificate file to verify the peer.
|
|
281
|
+
"""
|
|
282
|
+
self.cert_file = None
|
|
283
|
+
"""client certificate file
|
|
284
|
+
"""
|
|
285
|
+
self.key_file = None
|
|
286
|
+
"""client key file
|
|
287
|
+
"""
|
|
288
|
+
self.assert_hostname = None
|
|
289
|
+
"""Set this to True/False to enable/disable SSL hostname verification.
|
|
290
|
+
"""
|
|
291
|
+
self.tls_server_name = None
|
|
292
|
+
"""SSL/TLS Server Name Indication (SNI)
|
|
293
|
+
Set this to the SNI value expected by the server.
|
|
294
|
+
"""
|
|
295
|
+
|
|
296
|
+
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
|
|
297
|
+
"""urllib3 connection pool's maximum number of connections saved
|
|
298
|
+
per pool. urllib3 uses 1 connection as default value, but this is
|
|
299
|
+
not the best value when you are making a lot of possibly parallel
|
|
300
|
+
requests to the same host, which is often the case here.
|
|
301
|
+
cpu_count * 5 is used as default value to increase performance.
|
|
302
|
+
"""
|
|
303
|
+
|
|
304
|
+
self.proxy: Optional[str] = None
|
|
305
|
+
"""Proxy URL
|
|
306
|
+
"""
|
|
307
|
+
self.proxy_headers = None
|
|
308
|
+
"""Proxy headers
|
|
309
|
+
"""
|
|
310
|
+
self.safe_chars_for_path_param = ''
|
|
311
|
+
"""Safe chars for path_param
|
|
312
|
+
"""
|
|
313
|
+
self.retries = retries
|
|
314
|
+
"""Adding retries to override urllib3 default value 3
|
|
315
|
+
"""
|
|
316
|
+
# Enable client side validation
|
|
317
|
+
self.client_side_validation = True
|
|
318
|
+
|
|
319
|
+
self.socket_options = None
|
|
320
|
+
"""Options to pass down to the underlying urllib3 socket
|
|
321
|
+
"""
|
|
322
|
+
|
|
323
|
+
self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
|
|
324
|
+
"""datetime format
|
|
325
|
+
"""
|
|
326
|
+
|
|
327
|
+
self.date_format = "%Y-%m-%d"
|
|
328
|
+
"""date format
|
|
329
|
+
"""
|
|
330
|
+
|
|
331
|
+
def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
|
|
332
|
+
cls = self.__class__
|
|
333
|
+
result = cls.__new__(cls)
|
|
334
|
+
memo[id(self)] = result
|
|
335
|
+
for k, v in self.__dict__.items():
|
|
336
|
+
if k not in ('logger', 'logger_file_handler'):
|
|
337
|
+
setattr(result, k, copy.deepcopy(v, memo))
|
|
338
|
+
# shallow copy of loggers
|
|
339
|
+
result.logger = copy.copy(self.logger)
|
|
340
|
+
# use setters to configure loggers
|
|
341
|
+
result.logger_file = self.logger_file
|
|
342
|
+
result.debug = self.debug
|
|
343
|
+
return result
|
|
344
|
+
|
|
345
|
+
def __setattr__(self, name: str, value: Any) -> None:
|
|
346
|
+
object.__setattr__(self, name, value)
|
|
347
|
+
|
|
348
|
+
@classmethod
|
|
349
|
+
def set_default(cls, default: Optional[Self]) -> None:
|
|
350
|
+
"""Set default instance of configuration.
|
|
351
|
+
|
|
352
|
+
It stores default configuration, which can be
|
|
353
|
+
returned by get_default_copy method.
|
|
354
|
+
|
|
355
|
+
:param default: object of Configuration
|
|
356
|
+
"""
|
|
357
|
+
cls._default = default
|
|
358
|
+
|
|
359
|
+
@classmethod
|
|
360
|
+
def get_default_copy(cls) -> Self:
|
|
361
|
+
"""Deprecated. Please use `get_default` instead.
|
|
362
|
+
|
|
363
|
+
Deprecated. Please use `get_default` instead.
|
|
364
|
+
|
|
365
|
+
:return: The configuration object.
|
|
366
|
+
"""
|
|
367
|
+
return cls.get_default()
|
|
368
|
+
|
|
369
|
+
@classmethod
|
|
370
|
+
def get_default(cls) -> Self:
|
|
371
|
+
"""Return the default configuration.
|
|
372
|
+
|
|
373
|
+
This method returns newly created, based on default constructor,
|
|
374
|
+
object of Configuration class or returns a copy of default
|
|
375
|
+
configuration.
|
|
376
|
+
|
|
377
|
+
:return: The configuration object.
|
|
378
|
+
"""
|
|
379
|
+
if cls._default is None:
|
|
380
|
+
cls._default = cls()
|
|
381
|
+
return cls._default
|
|
382
|
+
|
|
383
|
+
@property
|
|
384
|
+
def logger_file(self) -> Optional[str]:
|
|
385
|
+
"""The logger file.
|
|
386
|
+
|
|
387
|
+
If the logger_file is None, then add stream handler and remove file
|
|
388
|
+
handler. Otherwise, add file handler and remove stream handler.
|
|
389
|
+
|
|
390
|
+
:param value: The logger_file path.
|
|
391
|
+
:type: str
|
|
392
|
+
"""
|
|
393
|
+
return self.__logger_file
|
|
394
|
+
|
|
395
|
+
@logger_file.setter
|
|
396
|
+
def logger_file(self, value: Optional[str]) -> None:
|
|
397
|
+
"""The logger file.
|
|
398
|
+
|
|
399
|
+
If the logger_file is None, then add stream handler and remove file
|
|
400
|
+
handler. Otherwise, add file handler and remove stream handler.
|
|
401
|
+
|
|
402
|
+
:param value: The logger_file path.
|
|
403
|
+
:type: str
|
|
404
|
+
"""
|
|
405
|
+
self.__logger_file = value
|
|
406
|
+
if self.__logger_file:
|
|
407
|
+
# If set logging file,
|
|
408
|
+
# then add file handler and remove stream handler.
|
|
409
|
+
self.logger_file_handler = logging.FileHandler(self.__logger_file)
|
|
410
|
+
self.logger_file_handler.setFormatter(self.logger_formatter)
|
|
411
|
+
for _, logger in self.logger.items():
|
|
412
|
+
logger.addHandler(self.logger_file_handler)
|
|
413
|
+
|
|
414
|
+
@property
|
|
415
|
+
def debug(self) -> bool:
|
|
416
|
+
"""Debug status
|
|
417
|
+
|
|
418
|
+
:param value: The debug status, True or False.
|
|
419
|
+
:type: bool
|
|
420
|
+
"""
|
|
421
|
+
return self.__debug
|
|
422
|
+
|
|
423
|
+
@debug.setter
|
|
424
|
+
def debug(self, value: bool) -> None:
|
|
425
|
+
"""Debug status
|
|
426
|
+
|
|
427
|
+
:param value: The debug status, True or False.
|
|
428
|
+
:type: bool
|
|
429
|
+
"""
|
|
430
|
+
self.__debug = value
|
|
431
|
+
if self.__debug:
|
|
432
|
+
# if debug status is True, turn on debug logging
|
|
433
|
+
for _, logger in self.logger.items():
|
|
434
|
+
logger.setLevel(logging.DEBUG)
|
|
435
|
+
# turn on httplib debug
|
|
436
|
+
httplib.HTTPConnection.debuglevel = 1
|
|
437
|
+
else:
|
|
438
|
+
# if debug status is False, turn off debug logging,
|
|
439
|
+
# setting log level to default `logging.WARNING`
|
|
440
|
+
for _, logger in self.logger.items():
|
|
441
|
+
logger.setLevel(logging.WARNING)
|
|
442
|
+
# turn off httplib debug
|
|
443
|
+
httplib.HTTPConnection.debuglevel = 0
|
|
444
|
+
|
|
445
|
+
@property
|
|
446
|
+
def logger_format(self) -> str:
|
|
447
|
+
"""The logger format.
|
|
448
|
+
|
|
449
|
+
The logger_formatter will be updated when sets logger_format.
|
|
450
|
+
|
|
451
|
+
:param value: The format string.
|
|
452
|
+
:type: str
|
|
453
|
+
"""
|
|
454
|
+
return self.__logger_format
|
|
455
|
+
|
|
456
|
+
@logger_format.setter
|
|
457
|
+
def logger_format(self, value: str) -> None:
|
|
458
|
+
"""The logger format.
|
|
459
|
+
|
|
460
|
+
The logger_formatter will be updated when sets logger_format.
|
|
461
|
+
|
|
462
|
+
:param value: The format string.
|
|
463
|
+
:type: str
|
|
464
|
+
"""
|
|
465
|
+
self.__logger_format = value
|
|
466
|
+
self.logger_formatter = logging.Formatter(self.__logger_format)
|
|
467
|
+
|
|
468
|
+
def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]:
|
|
469
|
+
"""Gets API key (with prefix if set).
|
|
470
|
+
|
|
471
|
+
:param identifier: The identifier of apiKey.
|
|
472
|
+
:param alias: The alternative identifier of apiKey.
|
|
473
|
+
:return: The token for api key authentication.
|
|
474
|
+
"""
|
|
475
|
+
if self.refresh_api_key_hook is not None:
|
|
476
|
+
self.refresh_api_key_hook(self)
|
|
477
|
+
key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
|
|
478
|
+
if key:
|
|
479
|
+
prefix = self.api_key_prefix.get(identifier)
|
|
480
|
+
if prefix:
|
|
481
|
+
return "%s %s" % (prefix, key)
|
|
482
|
+
else:
|
|
483
|
+
return key
|
|
484
|
+
|
|
485
|
+
return None
|
|
486
|
+
|
|
487
|
+
def get_basic_auth_token(self) -> Optional[str]:
|
|
488
|
+
"""Gets HTTP basic authentication header (string).
|
|
489
|
+
|
|
490
|
+
:return: The token for basic HTTP authentication.
|
|
491
|
+
"""
|
|
492
|
+
username = ""
|
|
493
|
+
if self.username is not None:
|
|
494
|
+
username = self.username
|
|
495
|
+
password = ""
|
|
496
|
+
if self.password is not None:
|
|
497
|
+
password = self.password
|
|
498
|
+
return urllib3.util.make_headers(
|
|
499
|
+
basic_auth=username + ':' + password
|
|
500
|
+
).get('authorization')
|
|
501
|
+
|
|
502
|
+
def auth_settings(self)-> AuthSettings:
|
|
503
|
+
"""Gets Auth Settings dict for api client.
|
|
504
|
+
|
|
505
|
+
:return: The Auth Settings information dict.
|
|
506
|
+
"""
|
|
507
|
+
auth: AuthSettings = {}
|
|
508
|
+
if 'ApiKeyAuth' in self.api_key:
|
|
509
|
+
auth['ApiKeyAuth'] = {
|
|
510
|
+
'type': 'api_key',
|
|
511
|
+
'in': 'header',
|
|
512
|
+
'key': 'authorization',
|
|
513
|
+
'value': self.get_api_key_with_prefix(
|
|
514
|
+
'ApiKeyAuth',
|
|
515
|
+
),
|
|
516
|
+
}
|
|
517
|
+
return auth
|
|
518
|
+
|
|
519
|
+
def to_debug_report(self) -> str:
|
|
520
|
+
"""Gets the essential information for debugging.
|
|
521
|
+
|
|
522
|
+
:return: The report for debugging.
|
|
523
|
+
"""
|
|
524
|
+
return "Python SDK Debug Report:\n"\
|
|
525
|
+
"OS: {env}\n"\
|
|
526
|
+
"Python Version: {pyversion}\n"\
|
|
527
|
+
"Version of the API: 1.291.1002\n"\
|
|
528
|
+
"SDK Package Version: 1.0.0".\
|
|
529
|
+
format(env=sys.platform, pyversion=sys.version)
|
|
530
|
+
|
|
531
|
+
def get_host_settings(self) -> List[HostSetting]:
|
|
532
|
+
"""Gets an array of host settings
|
|
533
|
+
|
|
534
|
+
:return: An array of host settings
|
|
535
|
+
"""
|
|
536
|
+
return [
|
|
537
|
+
{
|
|
538
|
+
'url': "https://{unit}-{tenant}.instana.io",
|
|
539
|
+
'description': "Instana Backend",
|
|
540
|
+
'variables': {
|
|
541
|
+
'tenant': {
|
|
542
|
+
'description': "Customer tenant unit",
|
|
543
|
+
'default_value': "tenant",
|
|
544
|
+
},
|
|
545
|
+
'unit': {
|
|
546
|
+
'description': "Customer tenant name",
|
|
547
|
+
'default_value': "unit",
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
'url': "https://{domain}",
|
|
553
|
+
'description': "Instana Self-Hosted Backend",
|
|
554
|
+
'variables': {
|
|
555
|
+
'domain': {
|
|
556
|
+
'description': "Customer Self-Hosted domain",
|
|
557
|
+
'default_value': "example. com",
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
]
|
|
562
|
+
|
|
563
|
+
def get_host_from_settings(
|
|
564
|
+
self,
|
|
565
|
+
index: Optional[int],
|
|
566
|
+
variables: Optional[ServerVariablesT]=None,
|
|
567
|
+
servers: Optional[List[HostSetting]]=None,
|
|
568
|
+
) -> str:
|
|
569
|
+
"""Gets host URL based on the index and variables
|
|
570
|
+
:param index: array index of the host settings
|
|
571
|
+
:param variables: hash of variable and the corresponding value
|
|
572
|
+
:param servers: an array of host settings or None
|
|
573
|
+
:return: URL based on host settings
|
|
574
|
+
"""
|
|
575
|
+
if index is None:
|
|
576
|
+
return self._base_path
|
|
577
|
+
|
|
578
|
+
variables = {} if variables is None else variables
|
|
579
|
+
servers = self.get_host_settings() if servers is None else servers
|
|
580
|
+
|
|
581
|
+
try:
|
|
582
|
+
server = servers[index]
|
|
583
|
+
except IndexError:
|
|
584
|
+
raise ValueError(
|
|
585
|
+
"Invalid index {0} when selecting the host settings. "
|
|
586
|
+
"Must be less than {1}".format(index, len(servers)))
|
|
587
|
+
|
|
588
|
+
url = server['url']
|
|
589
|
+
|
|
590
|
+
# go through variables and replace placeholders
|
|
591
|
+
for variable_name, variable in server.get('variables', {}).items():
|
|
592
|
+
used_value = variables.get(
|
|
593
|
+
variable_name, variable['default_value'])
|
|
594
|
+
|
|
595
|
+
if 'enum_values' in variable \
|
|
596
|
+
and used_value not in variable['enum_values']:
|
|
597
|
+
raise ValueError(
|
|
598
|
+
"The variable `{0}` in the host URL has invalid value "
|
|
599
|
+
"{1}. Must be {2}.".format(
|
|
600
|
+
variable_name, variables[variable_name],
|
|
601
|
+
variable['enum_values']))
|
|
602
|
+
|
|
603
|
+
url = url.replace("{" + variable_name + "}", used_value)
|
|
604
|
+
|
|
605
|
+
return url
|
|
606
|
+
|
|
607
|
+
@property
|
|
608
|
+
def host(self) -> str:
|
|
609
|
+
"""Return generated host."""
|
|
610
|
+
return self.get_host_from_settings(self.server_index, variables=self.server_variables)
|
|
611
|
+
|
|
612
|
+
@host.setter
|
|
613
|
+
def host(self, value: str) -> None:
|
|
614
|
+
"""Fix base path."""
|
|
615
|
+
self._base_path = value
|
|
616
|
+
self.server_index = None
|