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,798 @@
|
|
|
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 datetime
|
|
17
|
+
from dateutil.parser import parse
|
|
18
|
+
from enum import Enum
|
|
19
|
+
import decimal
|
|
20
|
+
import json
|
|
21
|
+
import mimetypes
|
|
22
|
+
import os
|
|
23
|
+
import re
|
|
24
|
+
import tempfile
|
|
25
|
+
|
|
26
|
+
from urllib.parse import quote
|
|
27
|
+
from typing import Tuple, Optional, List, Dict, Union
|
|
28
|
+
from pydantic import SecretStr
|
|
29
|
+
|
|
30
|
+
from instana_client.configuration import Configuration
|
|
31
|
+
from instana_client.api_response import ApiResponse, T as ApiResponseT
|
|
32
|
+
import instana_client.models
|
|
33
|
+
from instana_client import rest
|
|
34
|
+
from instana_client.exceptions import (
|
|
35
|
+
ApiValueError,
|
|
36
|
+
ApiException,
|
|
37
|
+
BadRequestException,
|
|
38
|
+
UnauthorizedException,
|
|
39
|
+
ForbiddenException,
|
|
40
|
+
NotFoundException,
|
|
41
|
+
ServiceException
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]]
|
|
45
|
+
|
|
46
|
+
class ApiClient:
|
|
47
|
+
"""Generic API client for OpenAPI client library builds.
|
|
48
|
+
|
|
49
|
+
OpenAPI generic API client. This client handles the client-
|
|
50
|
+
server communication, and is invariant across implementations. Specifics of
|
|
51
|
+
the methods and models for each application are generated from the OpenAPI
|
|
52
|
+
templates.
|
|
53
|
+
|
|
54
|
+
:param configuration: .Configuration object for this client
|
|
55
|
+
:param header_name: a header to pass when making calls to the API.
|
|
56
|
+
:param header_value: a header value to pass when making calls to
|
|
57
|
+
the API.
|
|
58
|
+
:param cookie: a cookie to include in the header when making calls
|
|
59
|
+
to the API
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
PRIMITIVE_TYPES = (float, bool, bytes, str, int)
|
|
63
|
+
NATIVE_TYPES_MAPPING = {
|
|
64
|
+
'int': int,
|
|
65
|
+
'long': int, # TODO remove as only py3 is supported?
|
|
66
|
+
'float': float,
|
|
67
|
+
'str': str,
|
|
68
|
+
'bool': bool,
|
|
69
|
+
'date': datetime.date,
|
|
70
|
+
'datetime': datetime.datetime,
|
|
71
|
+
'decimal': decimal.Decimal,
|
|
72
|
+
'object': object,
|
|
73
|
+
}
|
|
74
|
+
_pool = None
|
|
75
|
+
|
|
76
|
+
def __init__(
|
|
77
|
+
self,
|
|
78
|
+
configuration=None,
|
|
79
|
+
header_name=None,
|
|
80
|
+
header_value=None,
|
|
81
|
+
cookie=None
|
|
82
|
+
) -> None:
|
|
83
|
+
# use default configuration if none is provided
|
|
84
|
+
if configuration is None:
|
|
85
|
+
configuration = Configuration.get_default()
|
|
86
|
+
self.configuration = configuration
|
|
87
|
+
|
|
88
|
+
self.rest_client = rest.RESTClientObject(configuration)
|
|
89
|
+
self.default_headers = {}
|
|
90
|
+
if header_name is not None:
|
|
91
|
+
self.default_headers[header_name] = header_value
|
|
92
|
+
self.cookie = cookie
|
|
93
|
+
# Set default User-Agent.
|
|
94
|
+
self.user_agent = 'OpenAPI-Generator/1.0.0/python'
|
|
95
|
+
self.client_side_validation = configuration.client_side_validation
|
|
96
|
+
|
|
97
|
+
def __enter__(self):
|
|
98
|
+
return self
|
|
99
|
+
|
|
100
|
+
def __exit__(self, exc_type, exc_value, traceback):
|
|
101
|
+
pass
|
|
102
|
+
|
|
103
|
+
@property
|
|
104
|
+
def user_agent(self):
|
|
105
|
+
"""User agent for this API client"""
|
|
106
|
+
return self.default_headers['User-Agent']
|
|
107
|
+
|
|
108
|
+
@user_agent.setter
|
|
109
|
+
def user_agent(self, value):
|
|
110
|
+
self.default_headers['User-Agent'] = value
|
|
111
|
+
|
|
112
|
+
def set_default_header(self, header_name, header_value):
|
|
113
|
+
self.default_headers[header_name] = header_value
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
_default = None
|
|
117
|
+
|
|
118
|
+
@classmethod
|
|
119
|
+
def get_default(cls):
|
|
120
|
+
"""Return new instance of ApiClient.
|
|
121
|
+
|
|
122
|
+
This method returns newly created, based on default constructor,
|
|
123
|
+
object of ApiClient class or returns a copy of default
|
|
124
|
+
ApiClient.
|
|
125
|
+
|
|
126
|
+
:return: The ApiClient object.
|
|
127
|
+
"""
|
|
128
|
+
if cls._default is None:
|
|
129
|
+
cls._default = ApiClient()
|
|
130
|
+
return cls._default
|
|
131
|
+
|
|
132
|
+
@classmethod
|
|
133
|
+
def set_default(cls, default):
|
|
134
|
+
"""Set default instance of ApiClient.
|
|
135
|
+
|
|
136
|
+
It stores default ApiClient.
|
|
137
|
+
|
|
138
|
+
:param default: object of ApiClient.
|
|
139
|
+
"""
|
|
140
|
+
cls._default = default
|
|
141
|
+
|
|
142
|
+
def param_serialize(
|
|
143
|
+
self,
|
|
144
|
+
method,
|
|
145
|
+
resource_path,
|
|
146
|
+
path_params=None,
|
|
147
|
+
query_params=None,
|
|
148
|
+
header_params=None,
|
|
149
|
+
body=None,
|
|
150
|
+
post_params=None,
|
|
151
|
+
files=None, auth_settings=None,
|
|
152
|
+
collection_formats=None,
|
|
153
|
+
_host=None,
|
|
154
|
+
_request_auth=None
|
|
155
|
+
) -> RequestSerialized:
|
|
156
|
+
|
|
157
|
+
"""Builds the HTTP request params needed by the request.
|
|
158
|
+
:param method: Method to call.
|
|
159
|
+
:param resource_path: Path to method endpoint.
|
|
160
|
+
:param path_params: Path parameters in the url.
|
|
161
|
+
:param query_params: Query parameters in the url.
|
|
162
|
+
:param header_params: Header parameters to be
|
|
163
|
+
placed in the request header.
|
|
164
|
+
:param body: Request body.
|
|
165
|
+
:param post_params dict: Request post form parameters,
|
|
166
|
+
for `application/x-www-form-urlencoded`, `multipart/form-data`.
|
|
167
|
+
:param auth_settings list: Auth Settings names for the request.
|
|
168
|
+
:param files dict: key -> filename, value -> filepath,
|
|
169
|
+
for `multipart/form-data`.
|
|
170
|
+
:param collection_formats: dict of collection formats for path, query,
|
|
171
|
+
header, and post parameters.
|
|
172
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
173
|
+
request; this effectively ignores the authentication
|
|
174
|
+
in the spec for a single request.
|
|
175
|
+
:return: tuple of form (path, http_method, query_params, header_params,
|
|
176
|
+
body, post_params, files)
|
|
177
|
+
"""
|
|
178
|
+
|
|
179
|
+
config = self.configuration
|
|
180
|
+
|
|
181
|
+
# header parameters
|
|
182
|
+
header_params = header_params or {}
|
|
183
|
+
header_params.update(self.default_headers)
|
|
184
|
+
if self.cookie:
|
|
185
|
+
header_params['Cookie'] = self.cookie
|
|
186
|
+
if header_params:
|
|
187
|
+
header_params = self.sanitize_for_serialization(header_params)
|
|
188
|
+
header_params = dict(
|
|
189
|
+
self.parameters_to_tuples(header_params,collection_formats)
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
# path parameters
|
|
193
|
+
if path_params:
|
|
194
|
+
path_params = self.sanitize_for_serialization(path_params)
|
|
195
|
+
path_params = self.parameters_to_tuples(
|
|
196
|
+
path_params,
|
|
197
|
+
collection_formats
|
|
198
|
+
)
|
|
199
|
+
for k, v in path_params:
|
|
200
|
+
# specified safe chars, encode everything
|
|
201
|
+
resource_path = resource_path.replace(
|
|
202
|
+
'{%s}' % k,
|
|
203
|
+
quote(str(v), safe=config.safe_chars_for_path_param)
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
# post parameters
|
|
207
|
+
if post_params or files:
|
|
208
|
+
post_params = post_params if post_params else []
|
|
209
|
+
post_params = self.sanitize_for_serialization(post_params)
|
|
210
|
+
post_params = self.parameters_to_tuples(
|
|
211
|
+
post_params,
|
|
212
|
+
collection_formats
|
|
213
|
+
)
|
|
214
|
+
if files:
|
|
215
|
+
post_params.extend(self.files_parameters(files))
|
|
216
|
+
|
|
217
|
+
# auth setting
|
|
218
|
+
self.update_params_for_auth(
|
|
219
|
+
header_params,
|
|
220
|
+
query_params,
|
|
221
|
+
auth_settings,
|
|
222
|
+
resource_path,
|
|
223
|
+
method,
|
|
224
|
+
body,
|
|
225
|
+
request_auth=_request_auth
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
# body
|
|
229
|
+
if body:
|
|
230
|
+
body = self.sanitize_for_serialization(body)
|
|
231
|
+
|
|
232
|
+
# request url
|
|
233
|
+
if _host is None or self.configuration.ignore_operation_servers:
|
|
234
|
+
url = self.configuration.host + resource_path
|
|
235
|
+
else:
|
|
236
|
+
# use server/host defined in path or operation instead
|
|
237
|
+
url = _host + resource_path
|
|
238
|
+
|
|
239
|
+
# query parameters
|
|
240
|
+
if query_params:
|
|
241
|
+
query_params = self.sanitize_for_serialization(query_params)
|
|
242
|
+
url_query = self.parameters_to_url_query(
|
|
243
|
+
query_params,
|
|
244
|
+
collection_formats
|
|
245
|
+
)
|
|
246
|
+
url += "?" + url_query
|
|
247
|
+
|
|
248
|
+
return method, url, header_params, body, post_params
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
def call_api(
|
|
252
|
+
self,
|
|
253
|
+
method,
|
|
254
|
+
url,
|
|
255
|
+
header_params=None,
|
|
256
|
+
body=None,
|
|
257
|
+
post_params=None,
|
|
258
|
+
_request_timeout=None
|
|
259
|
+
) -> rest.RESTResponse:
|
|
260
|
+
"""Makes the HTTP request (synchronous)
|
|
261
|
+
:param method: Method to call.
|
|
262
|
+
:param url: Path to method endpoint.
|
|
263
|
+
:param header_params: Header parameters to be
|
|
264
|
+
placed in the request header.
|
|
265
|
+
:param body: Request body.
|
|
266
|
+
:param post_params dict: Request post form parameters,
|
|
267
|
+
for `application/x-www-form-urlencoded`, `multipart/form-data`.
|
|
268
|
+
:param _request_timeout: timeout setting for this request.
|
|
269
|
+
:return: RESTResponse
|
|
270
|
+
"""
|
|
271
|
+
|
|
272
|
+
try:
|
|
273
|
+
# perform request and return response
|
|
274
|
+
response_data = self.rest_client.request(
|
|
275
|
+
method, url,
|
|
276
|
+
headers=header_params,
|
|
277
|
+
body=body, post_params=post_params,
|
|
278
|
+
_request_timeout=_request_timeout
|
|
279
|
+
)
|
|
280
|
+
|
|
281
|
+
except ApiException as e:
|
|
282
|
+
raise e
|
|
283
|
+
|
|
284
|
+
return response_data
|
|
285
|
+
|
|
286
|
+
def response_deserialize(
|
|
287
|
+
self,
|
|
288
|
+
response_data: rest.RESTResponse,
|
|
289
|
+
response_types_map: Optional[Dict[str, ApiResponseT]]=None
|
|
290
|
+
) -> ApiResponse[ApiResponseT]:
|
|
291
|
+
"""Deserializes response into an object.
|
|
292
|
+
:param response_data: RESTResponse object to be deserialized.
|
|
293
|
+
:param response_types_map: dict of response types.
|
|
294
|
+
:return: ApiResponse
|
|
295
|
+
"""
|
|
296
|
+
|
|
297
|
+
msg = "RESTResponse.read() must be called before passing it to response_deserialize()"
|
|
298
|
+
assert response_data.data is not None, msg
|
|
299
|
+
|
|
300
|
+
response_type = response_types_map.get(str(response_data.status), None)
|
|
301
|
+
if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599:
|
|
302
|
+
# if not found, look for '1XX', '2XX', etc.
|
|
303
|
+
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
|
|
304
|
+
|
|
305
|
+
# deserialize response data
|
|
306
|
+
response_text = None
|
|
307
|
+
return_data = None
|
|
308
|
+
try:
|
|
309
|
+
if response_type == "bytearray":
|
|
310
|
+
return_data = response_data.data
|
|
311
|
+
elif response_type == "file":
|
|
312
|
+
return_data = self.__deserialize_file(response_data)
|
|
313
|
+
elif response_type is not None:
|
|
314
|
+
match = None
|
|
315
|
+
content_type = response_data.getheader('content-type')
|
|
316
|
+
if content_type is not None:
|
|
317
|
+
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
|
|
318
|
+
encoding = match.group(1) if match else "utf-8"
|
|
319
|
+
response_text = response_data.data.decode(encoding)
|
|
320
|
+
return_data = self.deserialize(response_text, response_type, content_type)
|
|
321
|
+
finally:
|
|
322
|
+
if not 200 <= response_data.status <= 299:
|
|
323
|
+
raise ApiException.from_response(
|
|
324
|
+
http_resp=response_data,
|
|
325
|
+
body=response_text,
|
|
326
|
+
data=return_data,
|
|
327
|
+
)
|
|
328
|
+
|
|
329
|
+
return ApiResponse(
|
|
330
|
+
status_code = response_data.status,
|
|
331
|
+
data = return_data,
|
|
332
|
+
headers = response_data.getheaders(),
|
|
333
|
+
raw_data = response_data.data
|
|
334
|
+
)
|
|
335
|
+
|
|
336
|
+
def sanitize_for_serialization(self, obj):
|
|
337
|
+
"""Builds a JSON POST object.
|
|
338
|
+
|
|
339
|
+
If obj is None, return None.
|
|
340
|
+
If obj is SecretStr, return obj.get_secret_value()
|
|
341
|
+
If obj is str, int, long, float, bool, return directly.
|
|
342
|
+
If obj is datetime.datetime, datetime.date
|
|
343
|
+
convert to string in iso8601 format.
|
|
344
|
+
If obj is decimal.Decimal return string representation.
|
|
345
|
+
If obj is list, sanitize each element in the list.
|
|
346
|
+
If obj is dict, return the dict.
|
|
347
|
+
If obj is OpenAPI model, return the properties dict.
|
|
348
|
+
|
|
349
|
+
:param obj: The data to serialize.
|
|
350
|
+
:return: The serialized form of data.
|
|
351
|
+
"""
|
|
352
|
+
if obj is None:
|
|
353
|
+
return None
|
|
354
|
+
elif isinstance(obj, Enum):
|
|
355
|
+
return obj.value
|
|
356
|
+
elif isinstance(obj, SecretStr):
|
|
357
|
+
return obj.get_secret_value()
|
|
358
|
+
elif isinstance(obj, self.PRIMITIVE_TYPES):
|
|
359
|
+
return obj
|
|
360
|
+
elif isinstance(obj, list):
|
|
361
|
+
return [
|
|
362
|
+
self.sanitize_for_serialization(sub_obj) for sub_obj in obj
|
|
363
|
+
]
|
|
364
|
+
elif isinstance(obj, tuple):
|
|
365
|
+
return tuple(
|
|
366
|
+
self.sanitize_for_serialization(sub_obj) for sub_obj in obj
|
|
367
|
+
)
|
|
368
|
+
elif isinstance(obj, (datetime.datetime, datetime.date)):
|
|
369
|
+
return obj.isoformat()
|
|
370
|
+
elif isinstance(obj, decimal.Decimal):
|
|
371
|
+
return str(obj)
|
|
372
|
+
|
|
373
|
+
elif isinstance(obj, dict):
|
|
374
|
+
obj_dict = obj
|
|
375
|
+
else:
|
|
376
|
+
# Convert model obj to dict except
|
|
377
|
+
# attributes `openapi_types`, `attribute_map`
|
|
378
|
+
# and attributes which value is not None.
|
|
379
|
+
# Convert attribute name to json key in
|
|
380
|
+
# model definition for request.
|
|
381
|
+
if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')):
|
|
382
|
+
obj_dict = obj.to_dict()
|
|
383
|
+
else:
|
|
384
|
+
obj_dict = obj.__dict__
|
|
385
|
+
|
|
386
|
+
return {
|
|
387
|
+
key: self.sanitize_for_serialization(val)
|
|
388
|
+
for key, val in obj_dict.items()
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):
|
|
392
|
+
"""Deserializes response into an object.
|
|
393
|
+
|
|
394
|
+
:param response: RESTResponse object to be deserialized.
|
|
395
|
+
:param response_type: class literal for
|
|
396
|
+
deserialized object, or string of class name.
|
|
397
|
+
:param content_type: content type of response.
|
|
398
|
+
|
|
399
|
+
:return: deserialized object.
|
|
400
|
+
"""
|
|
401
|
+
|
|
402
|
+
# fetch data from response object
|
|
403
|
+
if content_type is None:
|
|
404
|
+
try:
|
|
405
|
+
data = json.loads(response_text)
|
|
406
|
+
except ValueError:
|
|
407
|
+
data = response_text
|
|
408
|
+
elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
|
|
409
|
+
if response_text == "":
|
|
410
|
+
data = ""
|
|
411
|
+
else:
|
|
412
|
+
data = json.loads(response_text)
|
|
413
|
+
elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE):
|
|
414
|
+
data = response_text
|
|
415
|
+
else:
|
|
416
|
+
raise ApiException(
|
|
417
|
+
status=0,
|
|
418
|
+
reason="Unsupported content type: {0}".format(content_type)
|
|
419
|
+
)
|
|
420
|
+
|
|
421
|
+
return self.__deserialize(data, response_type)
|
|
422
|
+
|
|
423
|
+
def __deserialize(self, data, klass):
|
|
424
|
+
"""Deserializes dict, list, str into an object.
|
|
425
|
+
|
|
426
|
+
:param data: dict, list or str.
|
|
427
|
+
:param klass: class literal, or string of class name.
|
|
428
|
+
|
|
429
|
+
:return: object.
|
|
430
|
+
"""
|
|
431
|
+
if data is None:
|
|
432
|
+
return None
|
|
433
|
+
|
|
434
|
+
if isinstance(klass, str):
|
|
435
|
+
if klass.startswith('List['):
|
|
436
|
+
m = re.match(r'List\[(.*)]', klass)
|
|
437
|
+
assert m is not None, "Malformed List type definition"
|
|
438
|
+
sub_kls = m.group(1)
|
|
439
|
+
return [self.__deserialize(sub_data, sub_kls)
|
|
440
|
+
for sub_data in data]
|
|
441
|
+
|
|
442
|
+
if klass.startswith('Dict['):
|
|
443
|
+
m = re.match(r'Dict\[([^,]*), (.*)]', klass)
|
|
444
|
+
assert m is not None, "Malformed Dict type definition"
|
|
445
|
+
sub_kls = m.group(2)
|
|
446
|
+
return {k: self.__deserialize(v, sub_kls)
|
|
447
|
+
for k, v in data.items()}
|
|
448
|
+
|
|
449
|
+
# convert str to class
|
|
450
|
+
if klass in self.NATIVE_TYPES_MAPPING:
|
|
451
|
+
klass = self.NATIVE_TYPES_MAPPING[klass]
|
|
452
|
+
else:
|
|
453
|
+
klass = getattr(instana_client.models, klass)
|
|
454
|
+
|
|
455
|
+
if klass in self.PRIMITIVE_TYPES:
|
|
456
|
+
return self.__deserialize_primitive(data, klass)
|
|
457
|
+
elif klass == object:
|
|
458
|
+
return self.__deserialize_object(data)
|
|
459
|
+
elif klass == datetime.date:
|
|
460
|
+
return self.__deserialize_date(data)
|
|
461
|
+
elif klass == datetime.datetime:
|
|
462
|
+
return self.__deserialize_datetime(data)
|
|
463
|
+
elif klass == decimal.Decimal:
|
|
464
|
+
return decimal.Decimal(data)
|
|
465
|
+
elif issubclass(klass, Enum):
|
|
466
|
+
return self.__deserialize_enum(data, klass)
|
|
467
|
+
else:
|
|
468
|
+
return self.__deserialize_model(data, klass)
|
|
469
|
+
|
|
470
|
+
def parameters_to_tuples(self, params, collection_formats):
|
|
471
|
+
"""Get parameters as list of tuples, formatting collections.
|
|
472
|
+
|
|
473
|
+
:param params: Parameters as dict or list of two-tuples
|
|
474
|
+
:param dict collection_formats: Parameter collection formats
|
|
475
|
+
:return: Parameters as list of tuples, collections formatted
|
|
476
|
+
"""
|
|
477
|
+
new_params: List[Tuple[str, str]] = []
|
|
478
|
+
if collection_formats is None:
|
|
479
|
+
collection_formats = {}
|
|
480
|
+
for k, v in params.items() if isinstance(params, dict) else params:
|
|
481
|
+
if k in collection_formats:
|
|
482
|
+
collection_format = collection_formats[k]
|
|
483
|
+
if collection_format == 'multi':
|
|
484
|
+
new_params.extend((k, value) for value in v)
|
|
485
|
+
else:
|
|
486
|
+
if collection_format == 'ssv':
|
|
487
|
+
delimiter = ' '
|
|
488
|
+
elif collection_format == 'tsv':
|
|
489
|
+
delimiter = '\t'
|
|
490
|
+
elif collection_format == 'pipes':
|
|
491
|
+
delimiter = '|'
|
|
492
|
+
else: # csv is the default
|
|
493
|
+
delimiter = ','
|
|
494
|
+
new_params.append(
|
|
495
|
+
(k, delimiter.join(str(value) for value in v)))
|
|
496
|
+
else:
|
|
497
|
+
new_params.append((k, v))
|
|
498
|
+
return new_params
|
|
499
|
+
|
|
500
|
+
def parameters_to_url_query(self, params, collection_formats):
|
|
501
|
+
"""Get parameters as list of tuples, formatting collections.
|
|
502
|
+
|
|
503
|
+
:param params: Parameters as dict or list of two-tuples
|
|
504
|
+
:param dict collection_formats: Parameter collection formats
|
|
505
|
+
:return: URL query string (e.g. a=Hello%20World&b=123)
|
|
506
|
+
"""
|
|
507
|
+
new_params: List[Tuple[str, str]] = []
|
|
508
|
+
if collection_formats is None:
|
|
509
|
+
collection_formats = {}
|
|
510
|
+
for k, v in params.items() if isinstance(params, dict) else params:
|
|
511
|
+
if isinstance(v, bool):
|
|
512
|
+
v = str(v).lower()
|
|
513
|
+
if isinstance(v, (int, float)):
|
|
514
|
+
v = str(v)
|
|
515
|
+
if isinstance(v, dict):
|
|
516
|
+
v = json.dumps(v)
|
|
517
|
+
|
|
518
|
+
if k in collection_formats:
|
|
519
|
+
collection_format = collection_formats[k]
|
|
520
|
+
if collection_format == 'multi':
|
|
521
|
+
new_params.extend((k, quote(str(value))) for value in v)
|
|
522
|
+
else:
|
|
523
|
+
if collection_format == 'ssv':
|
|
524
|
+
delimiter = ' '
|
|
525
|
+
elif collection_format == 'tsv':
|
|
526
|
+
delimiter = '\t'
|
|
527
|
+
elif collection_format == 'pipes':
|
|
528
|
+
delimiter = '|'
|
|
529
|
+
else: # csv is the default
|
|
530
|
+
delimiter = ','
|
|
531
|
+
new_params.append(
|
|
532
|
+
(k, delimiter.join(quote(str(value)) for value in v))
|
|
533
|
+
)
|
|
534
|
+
else:
|
|
535
|
+
new_params.append((k, quote(str(v))))
|
|
536
|
+
|
|
537
|
+
return "&".join(["=".join(map(str, item)) for item in new_params])
|
|
538
|
+
|
|
539
|
+
def files_parameters(
|
|
540
|
+
self,
|
|
541
|
+
files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]],
|
|
542
|
+
):
|
|
543
|
+
"""Builds form parameters.
|
|
544
|
+
|
|
545
|
+
:param files: File parameters.
|
|
546
|
+
:return: Form parameters with files.
|
|
547
|
+
"""
|
|
548
|
+
params = []
|
|
549
|
+
for k, v in files.items():
|
|
550
|
+
if isinstance(v, str):
|
|
551
|
+
with open(v, 'rb') as f:
|
|
552
|
+
filename = os.path.basename(f.name)
|
|
553
|
+
filedata = f.read()
|
|
554
|
+
elif isinstance(v, bytes):
|
|
555
|
+
filename = k
|
|
556
|
+
filedata = v
|
|
557
|
+
elif isinstance(v, tuple):
|
|
558
|
+
filename, filedata = v
|
|
559
|
+
elif isinstance(v, list):
|
|
560
|
+
for file_param in v:
|
|
561
|
+
params.extend(self.files_parameters({k: file_param}))
|
|
562
|
+
continue
|
|
563
|
+
else:
|
|
564
|
+
raise ValueError("Unsupported file value")
|
|
565
|
+
mimetype = (
|
|
566
|
+
mimetypes.guess_type(filename)[0]
|
|
567
|
+
or 'application/octet-stream'
|
|
568
|
+
)
|
|
569
|
+
params.append(
|
|
570
|
+
tuple([k, tuple([filename, filedata, mimetype])])
|
|
571
|
+
)
|
|
572
|
+
return params
|
|
573
|
+
|
|
574
|
+
def select_header_accept(self, accepts: List[str]) -> Optional[str]:
|
|
575
|
+
"""Returns `Accept` based on an array of accepts provided.
|
|
576
|
+
|
|
577
|
+
:param accepts: List of headers.
|
|
578
|
+
:return: Accept (e.g. application/json).
|
|
579
|
+
"""
|
|
580
|
+
if not accepts:
|
|
581
|
+
return None
|
|
582
|
+
|
|
583
|
+
for accept in accepts:
|
|
584
|
+
if re.search('json', accept, re.IGNORECASE):
|
|
585
|
+
return accept
|
|
586
|
+
|
|
587
|
+
return accepts[0]
|
|
588
|
+
|
|
589
|
+
def select_header_content_type(self, content_types):
|
|
590
|
+
"""Returns `Content-Type` based on an array of content_types provided.
|
|
591
|
+
|
|
592
|
+
:param content_types: List of content-types.
|
|
593
|
+
:return: Content-Type (e.g. application/json).
|
|
594
|
+
"""
|
|
595
|
+
if not content_types:
|
|
596
|
+
return None
|
|
597
|
+
|
|
598
|
+
for content_type in content_types:
|
|
599
|
+
if re.search('json', content_type, re.IGNORECASE):
|
|
600
|
+
return content_type
|
|
601
|
+
|
|
602
|
+
return content_types[0]
|
|
603
|
+
|
|
604
|
+
def update_params_for_auth(
|
|
605
|
+
self,
|
|
606
|
+
headers,
|
|
607
|
+
queries,
|
|
608
|
+
auth_settings,
|
|
609
|
+
resource_path,
|
|
610
|
+
method,
|
|
611
|
+
body,
|
|
612
|
+
request_auth=None
|
|
613
|
+
) -> None:
|
|
614
|
+
"""Updates header and query params based on authentication setting.
|
|
615
|
+
|
|
616
|
+
:param headers: Header parameters dict to be updated.
|
|
617
|
+
:param queries: Query parameters tuple list to be updated.
|
|
618
|
+
:param auth_settings: Authentication setting identifiers list.
|
|
619
|
+
:resource_path: A string representation of the HTTP request resource path.
|
|
620
|
+
:method: A string representation of the HTTP request method.
|
|
621
|
+
:body: A object representing the body of the HTTP request.
|
|
622
|
+
The object type is the return value of sanitize_for_serialization().
|
|
623
|
+
:param request_auth: if set, the provided settings will
|
|
624
|
+
override the token in the configuration.
|
|
625
|
+
"""
|
|
626
|
+
if not auth_settings:
|
|
627
|
+
return
|
|
628
|
+
|
|
629
|
+
if request_auth:
|
|
630
|
+
self._apply_auth_params(
|
|
631
|
+
headers,
|
|
632
|
+
queries,
|
|
633
|
+
resource_path,
|
|
634
|
+
method,
|
|
635
|
+
body,
|
|
636
|
+
request_auth
|
|
637
|
+
)
|
|
638
|
+
else:
|
|
639
|
+
for auth in auth_settings:
|
|
640
|
+
auth_setting = self.configuration.auth_settings().get(auth)
|
|
641
|
+
if auth_setting:
|
|
642
|
+
self._apply_auth_params(
|
|
643
|
+
headers,
|
|
644
|
+
queries,
|
|
645
|
+
resource_path,
|
|
646
|
+
method,
|
|
647
|
+
body,
|
|
648
|
+
auth_setting
|
|
649
|
+
)
|
|
650
|
+
|
|
651
|
+
def _apply_auth_params(
|
|
652
|
+
self,
|
|
653
|
+
headers,
|
|
654
|
+
queries,
|
|
655
|
+
resource_path,
|
|
656
|
+
method,
|
|
657
|
+
body,
|
|
658
|
+
auth_setting
|
|
659
|
+
) -> None:
|
|
660
|
+
"""Updates the request parameters based on a single auth_setting
|
|
661
|
+
|
|
662
|
+
:param headers: Header parameters dict to be updated.
|
|
663
|
+
:param queries: Query parameters tuple list to be updated.
|
|
664
|
+
:resource_path: A string representation of the HTTP request resource path.
|
|
665
|
+
:method: A string representation of the HTTP request method.
|
|
666
|
+
:body: A object representing the body of the HTTP request.
|
|
667
|
+
The object type is the return value of sanitize_for_serialization().
|
|
668
|
+
:param auth_setting: auth settings for the endpoint
|
|
669
|
+
"""
|
|
670
|
+
if auth_setting['in'] == 'cookie':
|
|
671
|
+
headers['Cookie'] = auth_setting['value']
|
|
672
|
+
elif auth_setting['in'] == 'header':
|
|
673
|
+
if auth_setting['type'] != 'http-signature':
|
|
674
|
+
headers[auth_setting['key']] = auth_setting['value']
|
|
675
|
+
elif auth_setting['in'] == 'query':
|
|
676
|
+
queries.append((auth_setting['key'], auth_setting['value']))
|
|
677
|
+
else:
|
|
678
|
+
raise ApiValueError(
|
|
679
|
+
'Authentication token must be in `query` or `header`'
|
|
680
|
+
)
|
|
681
|
+
|
|
682
|
+
def __deserialize_file(self, response):
|
|
683
|
+
"""Deserializes body to file
|
|
684
|
+
|
|
685
|
+
Saves response body into a file in a temporary folder,
|
|
686
|
+
using the filename from the `Content-Disposition` header if provided.
|
|
687
|
+
|
|
688
|
+
handle file downloading
|
|
689
|
+
save response body into a tmp file and return the instance
|
|
690
|
+
|
|
691
|
+
:param response: RESTResponse.
|
|
692
|
+
:return: file path.
|
|
693
|
+
"""
|
|
694
|
+
fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
|
|
695
|
+
os.close(fd)
|
|
696
|
+
os.remove(path)
|
|
697
|
+
|
|
698
|
+
content_disposition = response.getheader("Content-Disposition")
|
|
699
|
+
if content_disposition:
|
|
700
|
+
m = re.search(
|
|
701
|
+
r'filename=[\'"]?([^\'"\s]+)[\'"]?',
|
|
702
|
+
content_disposition
|
|
703
|
+
)
|
|
704
|
+
assert m is not None, "Unexpected 'content-disposition' header value"
|
|
705
|
+
filename = m.group(1)
|
|
706
|
+
path = os.path.join(os.path.dirname(path), filename)
|
|
707
|
+
|
|
708
|
+
with open(path, "wb") as f:
|
|
709
|
+
f.write(response.data)
|
|
710
|
+
|
|
711
|
+
return path
|
|
712
|
+
|
|
713
|
+
def __deserialize_primitive(self, data, klass):
|
|
714
|
+
"""Deserializes string to primitive type.
|
|
715
|
+
|
|
716
|
+
:param data: str.
|
|
717
|
+
:param klass: class literal.
|
|
718
|
+
|
|
719
|
+
:return: int, long, float, str, bool.
|
|
720
|
+
"""
|
|
721
|
+
try:
|
|
722
|
+
return klass(data)
|
|
723
|
+
except UnicodeEncodeError:
|
|
724
|
+
return str(data)
|
|
725
|
+
except TypeError:
|
|
726
|
+
return data
|
|
727
|
+
|
|
728
|
+
def __deserialize_object(self, value):
|
|
729
|
+
"""Return an original value.
|
|
730
|
+
|
|
731
|
+
:return: object.
|
|
732
|
+
"""
|
|
733
|
+
return value
|
|
734
|
+
|
|
735
|
+
def __deserialize_date(self, string):
|
|
736
|
+
"""Deserializes string to date.
|
|
737
|
+
|
|
738
|
+
:param string: str.
|
|
739
|
+
:return: date.
|
|
740
|
+
"""
|
|
741
|
+
try:
|
|
742
|
+
return parse(string).date()
|
|
743
|
+
except ImportError:
|
|
744
|
+
return string
|
|
745
|
+
except ValueError:
|
|
746
|
+
raise rest.ApiException(
|
|
747
|
+
status=0,
|
|
748
|
+
reason="Failed to parse `{0}` as date object".format(string)
|
|
749
|
+
)
|
|
750
|
+
|
|
751
|
+
def __deserialize_datetime(self, string):
|
|
752
|
+
"""Deserializes string to datetime.
|
|
753
|
+
|
|
754
|
+
The string should be in iso8601 datetime format.
|
|
755
|
+
|
|
756
|
+
:param string: str.
|
|
757
|
+
:return: datetime.
|
|
758
|
+
"""
|
|
759
|
+
try:
|
|
760
|
+
return parse(string)
|
|
761
|
+
except ImportError:
|
|
762
|
+
return string
|
|
763
|
+
except ValueError:
|
|
764
|
+
raise rest.ApiException(
|
|
765
|
+
status=0,
|
|
766
|
+
reason=(
|
|
767
|
+
"Failed to parse `{0}` as datetime object"
|
|
768
|
+
.format(string)
|
|
769
|
+
)
|
|
770
|
+
)
|
|
771
|
+
|
|
772
|
+
def __deserialize_enum(self, data, klass):
|
|
773
|
+
"""Deserializes primitive type to enum.
|
|
774
|
+
|
|
775
|
+
:param data: primitive type.
|
|
776
|
+
:param klass: class literal.
|
|
777
|
+
:return: enum value.
|
|
778
|
+
"""
|
|
779
|
+
try:
|
|
780
|
+
return klass(data)
|
|
781
|
+
except ValueError:
|
|
782
|
+
raise rest.ApiException(
|
|
783
|
+
status=0,
|
|
784
|
+
reason=(
|
|
785
|
+
"Failed to parse `{0}` as `{1}`"
|
|
786
|
+
.format(data, klass)
|
|
787
|
+
)
|
|
788
|
+
)
|
|
789
|
+
|
|
790
|
+
def __deserialize_model(self, data, klass):
|
|
791
|
+
"""Deserializes list or dict to model.
|
|
792
|
+
|
|
793
|
+
:param data: dict, list.
|
|
794
|
+
:param klass: class literal.
|
|
795
|
+
:return: model object.
|
|
796
|
+
"""
|
|
797
|
+
|
|
798
|
+
return klass.from_dict(data)
|