capo-codeguruprofiler 0.1.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.
Files changed (180) hide show
  1. capo_codeguruprofiler/__init__.py +74 -0
  2. capo_codeguruprofiler/_async.py +25 -0
  3. capo_codeguruprofiler/_auth/_identity.py +16 -0
  4. capo_codeguruprofiler/_auth/_providers.py +886 -0
  5. capo_codeguruprofiler/_auth/_signers.py +88 -0
  6. capo_codeguruprofiler/_auth/_sigv4.py +434 -0
  7. capo_codeguruprofiler/_auth/_zapros_handler.py +80 -0
  8. capo_codeguruprofiler/_iter.py +113 -0
  9. capo_codeguruprofiler/_operations/code_guru_profiler/add_notification_channels.py +185 -0
  10. capo_codeguruprofiler/_operations/code_guru_profiler/batch_get_frame_metric_data.py +202 -0
  11. capo_codeguruprofiler/_operations/code_guru_profiler/configure_agent.py +177 -0
  12. capo_codeguruprofiler/_operations/code_guru_profiler/create_profiling_group.py +180 -0
  13. capo_codeguruprofiler/_operations/code_guru_profiler/delete_profiling_group.py +165 -0
  14. capo_codeguruprofiler/_operations/code_guru_profiler/describe_profiling_group.py +169 -0
  15. capo_codeguruprofiler/_operations/code_guru_profiler/get_findings_report_account_summary.py +164 -0
  16. capo_codeguruprofiler/_operations/code_guru_profiler/get_notification_configuration.py +168 -0
  17. capo_codeguruprofiler/_operations/code_guru_profiler/get_policy.py +161 -0
  18. capo_codeguruprofiler/_operations/code_guru_profiler/get_profile.py +196 -0
  19. capo_codeguruprofiler/_operations/code_guru_profiler/get_recommendations.py +196 -0
  20. capo_codeguruprofiler/_operations/code_guru_profiler/list_findings_reports.py +197 -0
  21. capo_codeguruprofiler/_operations/code_guru_profiler/list_profile_times.py +196 -0
  22. capo_codeguruprofiler/_operations/code_guru_profiler/list_profiling_groups.py +160 -0
  23. capo_codeguruprofiler/_operations/code_guru_profiler/list_tags_for_resource.py +158 -0
  24. capo_codeguruprofiler/_operations/code_guru_profiler/post_agent_profile.py +168 -0
  25. capo_codeguruprofiler/_operations/code_guru_profiler/put_permission.py +182 -0
  26. capo_codeguruprofiler/_operations/code_guru_profiler/remove_notification_channel.py +169 -0
  27. capo_codeguruprofiler/_operations/code_guru_profiler/remove_permission.py +175 -0
  28. capo_codeguruprofiler/_operations/code_guru_profiler/submit_feedback.py +170 -0
  29. capo_codeguruprofiler/_operations/code_guru_profiler/tag_resource.py +158 -0
  30. capo_codeguruprofiler/_operations/code_guru_profiler/untag_resource.py +156 -0
  31. capo_codeguruprofiler/_operations/code_guru_profiler/update_profiling_group.py +181 -0
  32. capo_codeguruprofiler/_pagination.py +21 -0
  33. capo_codeguruprofiler/_protocol/__init__.py +1 -0
  34. capo_codeguruprofiler/_protocol/errors.py +93 -0
  35. capo_codeguruprofiler/_protocol/eventstream.py +238 -0
  36. capo_codeguruprofiler/_protocol/serialize.py +47 -0
  37. capo_codeguruprofiler/_protocol/xml.py +33 -0
  38. capo_codeguruprofiler/_resources/code_guru_profiler/profiling_group.py +2257 -0
  39. capo_codeguruprofiler/_rule_engine/__init__.py +0 -0
  40. capo_codeguruprofiler/_rule_engine/_aws_partition.py +160 -0
  41. capo_codeguruprofiler/_rule_engine/_endpoint_rule_set.py +138 -0
  42. capo_codeguruprofiler/_rule_engine/_endpoint_runtime.py +389 -0
  43. capo_codeguruprofiler/_services/_aws_config.py +160 -0
  44. capo_codeguruprofiler/_services/_pipeline.py +198 -0
  45. capo_codeguruprofiler/_services/async_code_guru_profiler.py +377 -0
  46. capo_codeguruprofiler/_services/code_guru_profiler.py +373 -0
  47. capo_codeguruprofiler/errors/__init__.py +35 -0
  48. capo_codeguruprofiler/errors/_base.py +94 -0
  49. capo_codeguruprofiler/errors/conflict_exception.py +45 -0
  50. capo_codeguruprofiler/errors/internal_server_exception.py +47 -0
  51. capo_codeguruprofiler/errors/resource_not_found_exception.py +47 -0
  52. capo_codeguruprofiler/errors/service_quota_exceeded_exception.py +49 -0
  53. capo_codeguruprofiler/errors/throttling_exception.py +45 -0
  54. capo_codeguruprofiler/errors/validation_exception.py +45 -0
  55. capo_codeguruprofiler/py.typed +0 -0
  56. capo_codeguruprofiler/types/_prelude/blob.py +12 -0
  57. capo_codeguruprofiler/types/_prelude/timestamp.py +17 -0
  58. capo_codeguruprofiler/types/action_group.py +5 -0
  59. capo_codeguruprofiler/types/add_notification_channels_request.py +44 -0
  60. capo_codeguruprofiler/types/add_notification_channels_response.py +42 -0
  61. capo_codeguruprofiler/types/agent_configuration.py +58 -0
  62. capo_codeguruprofiler/types/agent_orchestration_config.py +28 -0
  63. capo_codeguruprofiler/types/agent_parameter_field.py +5 -0
  64. capo_codeguruprofiler/types/agent_parameters.py +27 -0
  65. capo_codeguruprofiler/types/agent_profile.py +15 -0
  66. capo_codeguruprofiler/types/aggregated_profile.py +15 -0
  67. capo_codeguruprofiler/types/aggregated_profile_time.py +45 -0
  68. capo_codeguruprofiler/types/aggregation_period.py +5 -0
  69. capo_codeguruprofiler/types/anomalies.py +29 -0
  70. capo_codeguruprofiler/types/anomaly.py +62 -0
  71. capo_codeguruprofiler/types/anomaly_instance.py +77 -0
  72. capo_codeguruprofiler/types/anomaly_instance_id.py +5 -0
  73. capo_codeguruprofiler/types/anomaly_instances.py +31 -0
  74. capo_codeguruprofiler/types/batch_get_frame_metric_data_request.py +56 -0
  75. capo_codeguruprofiler/types/batch_get_frame_metric_data_response.py +130 -0
  76. capo_codeguruprofiler/types/channel.py +58 -0
  77. capo_codeguruprofiler/types/channel_id.py +5 -0
  78. capo_codeguruprofiler/types/channel_uri.py +6 -0
  79. capo_codeguruprofiler/types/channels.py +29 -0
  80. capo_codeguruprofiler/types/client_token.py +5 -0
  81. capo_codeguruprofiler/types/compute_platform.py +5 -0
  82. capo_codeguruprofiler/types/configure_agent_request.py +50 -0
  83. capo_codeguruprofiler/types/configure_agent_response.py +43 -0
  84. capo_codeguruprofiler/types/create_profiling_group_request.py +81 -0
  85. capo_codeguruprofiler/types/create_profiling_group_response.py +45 -0
  86. capo_codeguruprofiler/types/delete_profiling_group_request.py +26 -0
  87. capo_codeguruprofiler/types/delete_profiling_group_response.py +18 -0
  88. capo_codeguruprofiler/types/describe_profiling_group_request.py +26 -0
  89. capo_codeguruprofiler/types/describe_profiling_group_response.py +45 -0
  90. capo_codeguruprofiler/types/event_publisher.py +5 -0
  91. capo_codeguruprofiler/types/event_publishers.py +19 -0
  92. capo_codeguruprofiler/types/feedback_type.py +5 -0
  93. capo_codeguruprofiler/types/findings_report_id.py +5 -0
  94. capo_codeguruprofiler/types/findings_report_summaries.py +35 -0
  95. capo_codeguruprofiler/types/findings_report_summary.py +73 -0
  96. capo_codeguruprofiler/types/fleet_instance_id.py +5 -0
  97. capo_codeguruprofiler/types/frame_metric.py +56 -0
  98. capo_codeguruprofiler/types/frame_metric_data.py +33 -0
  99. capo_codeguruprofiler/types/frame_metric_datum.py +56 -0
  100. capo_codeguruprofiler/types/frame_metric_value.py +5 -0
  101. capo_codeguruprofiler/types/frame_metric_values.py +30 -0
  102. capo_codeguruprofiler/types/frame_metrics.py +29 -0
  103. capo_codeguruprofiler/types/get_findings_report_account_summary_request.py +31 -0
  104. capo_codeguruprofiler/types/get_findings_report_account_summary_response.py +56 -0
  105. capo_codeguruprofiler/types/get_notification_configuration_request.py +26 -0
  106. capo_codeguruprofiler/types/get_notification_configuration_response.py +45 -0
  107. capo_codeguruprofiler/types/get_policy_request.py +26 -0
  108. capo_codeguruprofiler/types/get_policy_response.py +38 -0
  109. capo_codeguruprofiler/types/get_profile_request.py +39 -0
  110. capo_codeguruprofiler/types/get_profile_response.py +45 -0
  111. capo_codeguruprofiler/types/get_recommendations_request.py +34 -0
  112. capo_codeguruprofiler/types/get_recommendations_response.py +110 -0
  113. capo_codeguruprofiler/types/list_findings_reports_request.py +41 -0
  114. capo_codeguruprofiler/types/list_findings_reports_response.py +56 -0
  115. capo_codeguruprofiler/types/list_of_timestamps.py +33 -0
  116. capo_codeguruprofiler/types/list_profile_times_request.py +45 -0
  117. capo_codeguruprofiler/types/list_profile_times_response.py +50 -0
  118. capo_codeguruprofiler/types/list_profiling_groups_request.py +31 -0
  119. capo_codeguruprofiler/types/list_profiling_groups_response.py +77 -0
  120. capo_codeguruprofiler/types/list_tags_for_resource_request.py +24 -0
  121. capo_codeguruprofiler/types/list_tags_for_resource_response.py +34 -0
  122. capo_codeguruprofiler/types/locale.py +6 -0
  123. capo_codeguruprofiler/types/match.py +43 -0
  124. capo_codeguruprofiler/types/matches.py +29 -0
  125. capo_codeguruprofiler/types/max_depth.py +5 -0
  126. capo_codeguruprofiler/types/max_results.py +5 -0
  127. capo_codeguruprofiler/types/metadata.py +27 -0
  128. capo_codeguruprofiler/types/metadata_field.py +5 -0
  129. capo_codeguruprofiler/types/metric.py +54 -0
  130. capo_codeguruprofiler/types/metric_type.py +5 -0
  131. capo_codeguruprofiler/types/notification_configuration.py +36 -0
  132. capo_codeguruprofiler/types/order_by.py +5 -0
  133. capo_codeguruprofiler/types/pagination_token.py +5 -0
  134. capo_codeguruprofiler/types/pattern.py +95 -0
  135. capo_codeguruprofiler/types/percentage.py +5 -0
  136. capo_codeguruprofiler/types/period.py +5 -0
  137. capo_codeguruprofiler/types/post_agent_profile_request.py +51 -0
  138. capo_codeguruprofiler/types/post_agent_profile_response.py +18 -0
  139. capo_codeguruprofiler/types/principal.py +5 -0
  140. capo_codeguruprofiler/types/principals.py +17 -0
  141. capo_codeguruprofiler/types/profile_time.py +36 -0
  142. capo_codeguruprofiler/types/profile_times.py +29 -0
  143. capo_codeguruprofiler/types/profiling_group_arn.py +5 -0
  144. capo_codeguruprofiler/types/profiling_group_description.py +132 -0
  145. capo_codeguruprofiler/types/profiling_group_descriptions.py +37 -0
  146. capo_codeguruprofiler/types/profiling_group_name.py +5 -0
  147. capo_codeguruprofiler/types/profiling_group_names.py +19 -0
  148. capo_codeguruprofiler/types/profiling_status.py +83 -0
  149. capo_codeguruprofiler/types/put_permission_request.py +54 -0
  150. capo_codeguruprofiler/types/put_permission_response.py +38 -0
  151. capo_codeguruprofiler/types/recommendation.py +108 -0
  152. capo_codeguruprofiler/types/recommendations.py +31 -0
  153. capo_codeguruprofiler/types/remove_notification_channel_request.py +29 -0
  154. capo_codeguruprofiler/types/remove_notification_channel_response.py +42 -0
  155. capo_codeguruprofiler/types/remove_permission_request.py +32 -0
  156. capo_codeguruprofiler/types/remove_permission_response.py +38 -0
  157. capo_codeguruprofiler/types/revision_id.py +5 -0
  158. capo_codeguruprofiler/types/strings.py +14 -0
  159. capo_codeguruprofiler/types/submit_feedback_request.py +47 -0
  160. capo_codeguruprofiler/types/submit_feedback_response.py +18 -0
  161. capo_codeguruprofiler/types/tag_keys.py +14 -0
  162. capo_codeguruprofiler/types/tag_resource_request.py +40 -0
  163. capo_codeguruprofiler/types/tag_resource_response.py +18 -0
  164. capo_codeguruprofiler/types/tags_map.py +22 -0
  165. capo_codeguruprofiler/types/target_frame.py +14 -0
  166. capo_codeguruprofiler/types/target_frames.py +29 -0
  167. capo_codeguruprofiler/types/thread_states.py +14 -0
  168. capo_codeguruprofiler/types/timestamp.py +20 -0
  169. capo_codeguruprofiler/types/timestamp_structure.py +37 -0
  170. capo_codeguruprofiler/types/unprocessed_end_time_map.py +33 -0
  171. capo_codeguruprofiler/types/untag_resource_request.py +27 -0
  172. capo_codeguruprofiler/types/untag_resource_response.py +18 -0
  173. capo_codeguruprofiler/types/update_profiling_group_request.py +50 -0
  174. capo_codeguruprofiler/types/update_profiling_group_response.py +45 -0
  175. capo_codeguruprofiler/types/user_feedback.py +31 -0
  176. capo_codeguruprofiler-0.1.0.dist-info/METADATA +101 -0
  177. capo_codeguruprofiler-0.1.0.dist-info/RECORD +180 -0
  178. capo_codeguruprofiler-0.1.0.dist-info/WHEEL +5 -0
  179. capo_codeguruprofiler-0.1.0.dist-info/licenses/LICENSE +21 -0
  180. capo_codeguruprofiler-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2257 @@
1
+ from __future__ import annotations
2
+
3
+ import uuid
4
+ from typing import TYPE_CHECKING, Optional
5
+
6
+ import capo_codeguruprofiler._auth._signers
7
+ import capo_codeguruprofiler._auth._sigv4
8
+ from capo_codeguruprofiler._services._pipeline import (
9
+ AsyncOperationRequest,
10
+ AsyncOperationResponse,
11
+ OperationRequest,
12
+ OperationResponse,
13
+ aexecute_pipeline,
14
+ execute_pipeline,
15
+ )
16
+
17
+ if TYPE_CHECKING:
18
+ import capo_codeguruprofiler.types.action_group
19
+ import capo_codeguruprofiler.types.add_notification_channels_request
20
+ import capo_codeguruprofiler.types.add_notification_channels_response
21
+ import capo_codeguruprofiler.types.agent_orchestration_config
22
+ import capo_codeguruprofiler.types.agent_profile
23
+ import capo_codeguruprofiler.types.aggregation_period
24
+ import capo_codeguruprofiler.types.anomaly_instance_id
25
+ import capo_codeguruprofiler.types.batch_get_frame_metric_data_request
26
+ import capo_codeguruprofiler.types.batch_get_frame_metric_data_response
27
+ import capo_codeguruprofiler.types.channel_id
28
+ import capo_codeguruprofiler.types.channels
29
+ import capo_codeguruprofiler.types.client_token
30
+ import capo_codeguruprofiler.types.compute_platform
31
+ import capo_codeguruprofiler.types.configure_agent_request
32
+ import capo_codeguruprofiler.types.configure_agent_response
33
+ import capo_codeguruprofiler.types.create_profiling_group_request
34
+ import capo_codeguruprofiler.types.create_profiling_group_response
35
+ import capo_codeguruprofiler.types.delete_profiling_group_request
36
+ import capo_codeguruprofiler.types.delete_profiling_group_response
37
+ import capo_codeguruprofiler.types.describe_profiling_group_request
38
+ import capo_codeguruprofiler.types.describe_profiling_group_response
39
+ import capo_codeguruprofiler.types.feedback_type
40
+ import capo_codeguruprofiler.types.fleet_instance_id
41
+ import capo_codeguruprofiler.types.frame_metrics
42
+ import capo_codeguruprofiler.types.get_notification_configuration_request
43
+ import capo_codeguruprofiler.types.get_notification_configuration_response
44
+ import capo_codeguruprofiler.types.get_policy_request
45
+ import capo_codeguruprofiler.types.get_policy_response
46
+ import capo_codeguruprofiler.types.get_profile_request
47
+ import capo_codeguruprofiler.types.get_profile_response
48
+ import capo_codeguruprofiler.types.get_recommendations_request
49
+ import capo_codeguruprofiler.types.get_recommendations_response
50
+ import capo_codeguruprofiler.types.list_findings_reports_request
51
+ import capo_codeguruprofiler.types.list_findings_reports_response
52
+ import capo_codeguruprofiler.types.list_profile_times_request
53
+ import capo_codeguruprofiler.types.list_profile_times_response
54
+ import capo_codeguruprofiler.types.list_profiling_groups_request
55
+ import capo_codeguruprofiler.types.list_profiling_groups_response
56
+ import capo_codeguruprofiler.types.locale
57
+ import capo_codeguruprofiler.types.max_depth
58
+ import capo_codeguruprofiler.types.max_results
59
+ import capo_codeguruprofiler.types.metadata
60
+ import capo_codeguruprofiler.types.order_by
61
+ import capo_codeguruprofiler.types.pagination_token
62
+ import capo_codeguruprofiler.types.period
63
+ import capo_codeguruprofiler.types.post_agent_profile_request
64
+ import capo_codeguruprofiler.types.post_agent_profile_response
65
+ import capo_codeguruprofiler.types.principals
66
+ import capo_codeguruprofiler.types.profile_time
67
+ import capo_codeguruprofiler.types.profiling_group_name
68
+ import capo_codeguruprofiler.types.put_permission_request
69
+ import capo_codeguruprofiler.types.put_permission_response
70
+ import capo_codeguruprofiler.types.remove_notification_channel_request
71
+ import capo_codeguruprofiler.types.remove_notification_channel_response
72
+ import capo_codeguruprofiler.types.remove_permission_request
73
+ import capo_codeguruprofiler.types.remove_permission_response
74
+ import capo_codeguruprofiler.types.revision_id
75
+ import capo_codeguruprofiler.types.submit_feedback_request
76
+ import capo_codeguruprofiler.types.submit_feedback_response
77
+ import capo_codeguruprofiler.types.tags_map
78
+ import capo_codeguruprofiler.types.timestamp
79
+ import capo_codeguruprofiler.types.update_profiling_group_request
80
+ import capo_codeguruprofiler.types.update_profiling_group_response
81
+ from capo_codeguruprofiler._services.async_code_guru_profiler import (
82
+ AsyncCodeGuruProfilerClient,
83
+ AsyncCodeGuruProfilerClientConfig,
84
+ )
85
+ from capo_codeguruprofiler._services.code_guru_profiler import (
86
+ CodeGuruProfilerClient,
87
+ CodeGuruProfilerClientConfig,
88
+ )
89
+
90
+
91
+ class ProfilingGroup:
92
+ def __init__(self, service: CodeGuruProfilerClient) -> None:
93
+ self._service = service
94
+
95
+ def put(
96
+ self,
97
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
98
+ client_token: "capo_codeguruprofiler.types.client_token.ClientToken",
99
+ *,
100
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
101
+ compute_platform: Optional[
102
+ "capo_codeguruprofiler.types.compute_platform.ComputePlatform"
103
+ ] = None,
104
+ agent_orchestration_config: Optional[
105
+ "capo_codeguruprofiler.types.agent_orchestration_config.AgentOrchestrationConfig"
106
+ ] = None,
107
+ tags: Optional["capo_codeguruprofiler.types.tags_map.TagsMap"] = None,
108
+ ) -> "capo_codeguruprofiler.types.create_profiling_group_response.CreateProfilingGroupResponse":
109
+ """<p>Creates a profiling group.</p>
110
+
111
+ Args:
112
+ profiling_group_name: <p>The name of the profiling group to create.</p>
113
+ compute_platform: <p> The compute platform of the profiling group. Use <code>AWSLambda</code> if your application runs on AWS Lambda. Use <code>Default</code> if your application runs on a compute platform that is not AWS Lambda, such an Amazon EC2 instance, an on-premises server, or a different platform. If not specified, <code>Default</code> is used. </p>
114
+ client_token: <p> Amazon CodeGuru Profiler uses this universally unique identifier (UUID) to prevent the accidental creation of duplicate profiling groups if there are failures and retries. </p>
115
+ agent_orchestration_config: <p> Specifies whether profiling is enabled or disabled for the created profiling group. </p>
116
+ tags: <p> A list of tags to add to the created profiling group. </p>
117
+
118
+ Raises:
119
+ capo_codeguruprofiler.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
120
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
121
+ capo_codeguruprofiler.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use <a href=\"https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html\">Service Quotas</a> to request a service quota increase. </p>
122
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
123
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
124
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
125
+ """
126
+
127
+ def _handler(
128
+ req: "OperationRequest[capo_codeguruprofiler.types.create_profiling_group_request.CreateProfilingGroupRequest]",
129
+ ) -> OperationResponse[
130
+ "capo_codeguruprofiler.types.create_profiling_group_response.CreateProfilingGroupResponse"
131
+ ]:
132
+ import capo_codeguruprofiler._operations.code_guru_profiler.create_profiling_group
133
+
134
+ output, http_response = (
135
+ capo_codeguruprofiler._operations.code_guru_profiler.create_profiling_group.create_profiling_group(
136
+ req.options, req.input
137
+ )
138
+ )
139
+ return OperationResponse(output=output, response=http_response)
140
+
141
+ interceptors_, options_ = self._service.operation_options(config_overrides)
142
+ input_: capo_codeguruprofiler.types.create_profiling_group_request.CreateProfilingGroupRequest = {
143
+ "profiling_group_name": profiling_group_name,
144
+ "client_token": client_token,
145
+ }
146
+ if compute_platform is not None:
147
+ input_["compute_platform"] = compute_platform
148
+ if agent_orchestration_config is not None:
149
+ input_["agent_orchestration_config"] = agent_orchestration_config
150
+ if tags is not None:
151
+ input_["tags"] = tags
152
+
153
+ response = execute_pipeline(
154
+ OperationRequest(input=input_, options=options_),
155
+ handler=_handler,
156
+ interceptors=list(interceptors_),
157
+ )
158
+ response.response.close()
159
+ return response.output
160
+
161
+ def read(
162
+ self,
163
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
164
+ *,
165
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
166
+ ) -> "capo_codeguruprofiler.types.describe_profiling_group_response.DescribeProfilingGroupResponse":
167
+ r"""<p> Returns a <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html\"> <code>ProfilingGroupDescription</code> </a> object that contains information about the requested profiling group. </p>
168
+
169
+ Args:
170
+ profiling_group_name: <p> The name of the profiling group to get information about. </p>
171
+
172
+ Raises:
173
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
174
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
175
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
176
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
177
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
178
+ """
179
+
180
+ def _handler(
181
+ req: "OperationRequest[capo_codeguruprofiler.types.describe_profiling_group_request.DescribeProfilingGroupRequest]",
182
+ ) -> OperationResponse[
183
+ "capo_codeguruprofiler.types.describe_profiling_group_response.DescribeProfilingGroupResponse"
184
+ ]:
185
+ import capo_codeguruprofiler._operations.code_guru_profiler.describe_profiling_group
186
+
187
+ output, http_response = (
188
+ capo_codeguruprofiler._operations.code_guru_profiler.describe_profiling_group.describe_profiling_group(
189
+ req.options, req.input
190
+ )
191
+ )
192
+ return OperationResponse(output=output, response=http_response)
193
+
194
+ interceptors_, options_ = self._service.operation_options(config_overrides)
195
+ input_: capo_codeguruprofiler.types.describe_profiling_group_request.DescribeProfilingGroupRequest = {
196
+ "profiling_group_name": profiling_group_name
197
+ }
198
+
199
+ response = execute_pipeline(
200
+ OperationRequest(input=input_, options=options_),
201
+ handler=_handler,
202
+ interceptors=list(interceptors_),
203
+ )
204
+ response.response.close()
205
+ return response.output
206
+
207
+ def update(
208
+ self,
209
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
210
+ agent_orchestration_config: "capo_codeguruprofiler.types.agent_orchestration_config.AgentOrchestrationConfig",
211
+ *,
212
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
213
+ ) -> "capo_codeguruprofiler.types.update_profiling_group_response.UpdateProfilingGroupResponse":
214
+ """<p>Updates a profiling group.</p>
215
+
216
+ Args:
217
+ profiling_group_name: <p>The name of the profiling group to update.</p>
218
+ agent_orchestration_config: <p> Specifies whether profiling is enabled or disabled for a profiling group. </p>
219
+
220
+ Raises:
221
+ capo_codeguruprofiler.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
222
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
223
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
224
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
225
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
226
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
227
+ """
228
+
229
+ def _handler(
230
+ req: "OperationRequest[capo_codeguruprofiler.types.update_profiling_group_request.UpdateProfilingGroupRequest]",
231
+ ) -> OperationResponse[
232
+ "capo_codeguruprofiler.types.update_profiling_group_response.UpdateProfilingGroupResponse"
233
+ ]:
234
+ import capo_codeguruprofiler._operations.code_guru_profiler.update_profiling_group
235
+
236
+ output, http_response = (
237
+ capo_codeguruprofiler._operations.code_guru_profiler.update_profiling_group.update_profiling_group(
238
+ req.options, req.input
239
+ )
240
+ )
241
+ return OperationResponse(output=output, response=http_response)
242
+
243
+ interceptors_, options_ = self._service.operation_options(config_overrides)
244
+ input_: capo_codeguruprofiler.types.update_profiling_group_request.UpdateProfilingGroupRequest = {
245
+ "profiling_group_name": profiling_group_name,
246
+ "agent_orchestration_config": agent_orchestration_config,
247
+ }
248
+
249
+ response = execute_pipeline(
250
+ OperationRequest(input=input_, options=options_),
251
+ handler=_handler,
252
+ interceptors=list(interceptors_),
253
+ )
254
+ response.response.close()
255
+ return response.output
256
+
257
+ def delete(
258
+ self,
259
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
260
+ *,
261
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
262
+ ) -> "capo_codeguruprofiler.types.delete_profiling_group_response.DeleteProfilingGroupResponse":
263
+ """<p>Deletes a profiling group.</p>
264
+
265
+ Args:
266
+ profiling_group_name: <p>The name of the profiling group to delete.</p>
267
+
268
+ Raises:
269
+ capo_codeguruprofiler.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
270
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
271
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
272
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
273
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
274
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
275
+ """
276
+
277
+ def _handler(
278
+ req: "OperationRequest[capo_codeguruprofiler.types.delete_profiling_group_request.DeleteProfilingGroupRequest]",
279
+ ) -> OperationResponse[
280
+ "capo_codeguruprofiler.types.delete_profiling_group_response.DeleteProfilingGroupResponse"
281
+ ]:
282
+ import capo_codeguruprofiler._operations.code_guru_profiler.delete_profiling_group
283
+
284
+ output, http_response = (
285
+ capo_codeguruprofiler._operations.code_guru_profiler.delete_profiling_group.delete_profiling_group(
286
+ req.options, req.input
287
+ )
288
+ )
289
+ return OperationResponse(output=output, response=http_response)
290
+
291
+ interceptors_, options_ = self._service.operation_options(config_overrides)
292
+ input_: capo_codeguruprofiler.types.delete_profiling_group_request.DeleteProfilingGroupRequest = {
293
+ "profiling_group_name": profiling_group_name
294
+ }
295
+
296
+ response = execute_pipeline(
297
+ OperationRequest(input=input_, options=options_),
298
+ handler=_handler,
299
+ interceptors=list(interceptors_),
300
+ )
301
+ response.response.close()
302
+ return response.output
303
+
304
+ def list(
305
+ self,
306
+ *,
307
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
308
+ next_token: Optional[
309
+ "capo_codeguruprofiler.types.pagination_token.PaginationToken"
310
+ ] = None,
311
+ max_results: Optional[
312
+ "capo_codeguruprofiler.types.max_results.MaxResults"
313
+ ] = None,
314
+ include_description: Optional[bool] = None,
315
+ ) -> "capo_codeguruprofiler.types.list_profiling_groups_response.ListProfilingGroupsResponse":
316
+ r"""<p> Returns a list of profiling groups. The profiling groups are returned as <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html\"> <code>ProfilingGroupDescription</code> </a> objects. </p>
317
+
318
+ Args:
319
+ next_token: <p>The <code>nextToken</code> value returned from a previous paginated <code>ListProfilingGroups</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. </p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>
320
+ max_results: <p>The maximum number of profiling groups results returned by <code>ListProfilingGroups</code> in paginated output. When this parameter is used, <code>ListProfilingGroups</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListProfilingGroups</code> request with the returned <code>nextToken</code> value. </p>
321
+ include_description: <p>A <code>Boolean</code> value indicating whether to include a description. If <code>true</code>, then a list of <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html\"> <code>ProfilingGroupDescription</code> </a> objects that contain detailed information about profiling groups is returned. If <code>false</code>, then a list of profiling group names is returned.</p>
322
+
323
+ Raises:
324
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
325
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
326
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
327
+ """
328
+
329
+ def _handler(
330
+ req: "OperationRequest[capo_codeguruprofiler.types.list_profiling_groups_request.ListProfilingGroupsRequest]",
331
+ ) -> OperationResponse[
332
+ "capo_codeguruprofiler.types.list_profiling_groups_response.ListProfilingGroupsResponse"
333
+ ]:
334
+ import capo_codeguruprofiler._operations.code_guru_profiler.list_profiling_groups
335
+
336
+ output, http_response = (
337
+ capo_codeguruprofiler._operations.code_guru_profiler.list_profiling_groups.list_profiling_groups(
338
+ req.options, req.input
339
+ )
340
+ )
341
+ return OperationResponse(output=output, response=http_response)
342
+
343
+ interceptors_, options_ = self._service.operation_options(config_overrides)
344
+ input_: capo_codeguruprofiler.types.list_profiling_groups_request.ListProfilingGroupsRequest = {}
345
+ if next_token is not None:
346
+ input_["next_token"] = next_token
347
+ if max_results is not None:
348
+ input_["max_results"] = max_results
349
+ if include_description is not None:
350
+ input_["include_description"] = include_description
351
+
352
+ response = execute_pipeline(
353
+ OperationRequest(input=input_, options=options_),
354
+ handler=_handler,
355
+ interceptors=list(interceptors_),
356
+ )
357
+ response.response.close()
358
+ return response.output
359
+
360
+ def add_notification_channels(
361
+ self,
362
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
363
+ channels: "capo_codeguruprofiler.types.channels.Channels",
364
+ *,
365
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
366
+ ) -> "capo_codeguruprofiler.types.add_notification_channels_response.AddNotificationChannelsResponse":
367
+ """<p>Add up to 2 anomaly notifications channels for a profiling group.</p>
368
+
369
+ Args:
370
+ profiling_group_name: <p>The name of the profiling group that we are setting up notifications for.</p>
371
+ channels: <p>One or 2 channels to report to when anomalies are detected.</p>
372
+
373
+ Raises:
374
+ capo_codeguruprofiler.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
375
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
376
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
377
+ capo_codeguruprofiler.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use <a href=\"https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html\">Service Quotas</a> to request a service quota increase. </p>
378
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
379
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
380
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
381
+ """
382
+
383
+ def _handler(
384
+ req: "OperationRequest[capo_codeguruprofiler.types.add_notification_channels_request.AddNotificationChannelsRequest]",
385
+ ) -> OperationResponse[
386
+ "capo_codeguruprofiler.types.add_notification_channels_response.AddNotificationChannelsResponse"
387
+ ]:
388
+ import capo_codeguruprofiler._operations.code_guru_profiler.add_notification_channels
389
+
390
+ output, http_response = (
391
+ capo_codeguruprofiler._operations.code_guru_profiler.add_notification_channels.add_notification_channels(
392
+ req.options, req.input
393
+ )
394
+ )
395
+ return OperationResponse(output=output, response=http_response)
396
+
397
+ interceptors_, options_ = self._service.operation_options(config_overrides)
398
+ input_: capo_codeguruprofiler.types.add_notification_channels_request.AddNotificationChannelsRequest = {
399
+ "profiling_group_name": profiling_group_name,
400
+ "channels": channels,
401
+ }
402
+
403
+ response = execute_pipeline(
404
+ OperationRequest(input=input_, options=options_),
405
+ handler=_handler,
406
+ interceptors=list(interceptors_),
407
+ )
408
+ response.response.close()
409
+ return response.output
410
+
411
+ def batch_get_frame_metric_data(
412
+ self,
413
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
414
+ *,
415
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
416
+ start_time: Optional["capo_codeguruprofiler.types.timestamp.Timestamp"] = None,
417
+ end_time: Optional["capo_codeguruprofiler.types.timestamp.Timestamp"] = None,
418
+ period: Optional["capo_codeguruprofiler.types.period.Period"] = None,
419
+ target_resolution: Optional[
420
+ "capo_codeguruprofiler.types.aggregation_period.AggregationPeriod"
421
+ ] = None,
422
+ frame_metrics: Optional[
423
+ "capo_codeguruprofiler.types.frame_metrics.FrameMetrics"
424
+ ] = None,
425
+ ) -> "capo_codeguruprofiler.types.batch_get_frame_metric_data_response.BatchGetFrameMetricDataResponse":
426
+ """<p> Returns the time series of values for a requested list of frame metrics from a time period.</p>
427
+
428
+ Args:
429
+ profiling_group_name: <p> The name of the profiling group associated with the the frame metrics used to return the time series values. </p>
430
+ start_time: <p> The start time of the time period for the frame metrics used to return the time series values. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
431
+ end_time: <p> The end time of the time period for the returned time series values. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
432
+ period: <p> The duration of the frame metrics used to return the time series values. Specify using the ISO 8601 format. The maximum period duration is one day (<code>PT24H</code> or <code>P1D</code>). </p>
433
+ target_resolution: <p>The requested resolution of time steps for the returned time series of values. If the requested target resolution is not available due to data not being retained we provide a best effort result by falling back to the most granular available resolution after the target resolution. There are 3 valid values. </p> <ul> <li> <p> <code>P1D</code> — 1 day </p> </li> <li> <p> <code>PT1H</code> — 1 hour </p> </li> <li> <p> <code>PT5M</code> — 5 minutes </p> </li> </ul>
434
+ frame_metrics: <p> The details of the metrics that are used to request a time series of values. The metric includes the name of the frame, the aggregation type to calculate the metric value for the frame, and the thread states to use to get the count for the metric value of the frame.</p>
435
+
436
+ Raises:
437
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
438
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
439
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
440
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
441
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
442
+ """
443
+
444
+ def _handler(
445
+ req: "OperationRequest[capo_codeguruprofiler.types.batch_get_frame_metric_data_request.BatchGetFrameMetricDataRequest]",
446
+ ) -> OperationResponse[
447
+ "capo_codeguruprofiler.types.batch_get_frame_metric_data_response.BatchGetFrameMetricDataResponse"
448
+ ]:
449
+ import capo_codeguruprofiler._operations.code_guru_profiler.batch_get_frame_metric_data
450
+
451
+ output, http_response = (
452
+ capo_codeguruprofiler._operations.code_guru_profiler.batch_get_frame_metric_data.batch_get_frame_metric_data(
453
+ req.options, req.input
454
+ )
455
+ )
456
+ return OperationResponse(output=output, response=http_response)
457
+
458
+ interceptors_, options_ = self._service.operation_options(config_overrides)
459
+ input_: capo_codeguruprofiler.types.batch_get_frame_metric_data_request.BatchGetFrameMetricDataRequest = {
460
+ "profiling_group_name": profiling_group_name
461
+ }
462
+ if start_time is not None:
463
+ input_["start_time"] = start_time
464
+ if end_time is not None:
465
+ input_["end_time"] = end_time
466
+ if period is not None:
467
+ input_["period"] = period
468
+ if target_resolution is not None:
469
+ input_["target_resolution"] = target_resolution
470
+ if frame_metrics is not None:
471
+ input_["frame_metrics"] = frame_metrics
472
+
473
+ response = execute_pipeline(
474
+ OperationRequest(input=input_, options=options_),
475
+ handler=_handler,
476
+ interceptors=list(interceptors_),
477
+ )
478
+ response.response.close()
479
+ return response.output
480
+
481
+ def configure_agent(
482
+ self,
483
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
484
+ *,
485
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
486
+ fleet_instance_id: Optional[
487
+ "capo_codeguruprofiler.types.fleet_instance_id.FleetInstanceId"
488
+ ] = None,
489
+ metadata: Optional["capo_codeguruprofiler.types.metadata.Metadata"] = None,
490
+ ) -> "capo_codeguruprofiler.types.configure_agent_response.ConfigureAgentResponse":
491
+ """<p> Used by profiler agents to report their current state and to receive remote configuration updates. For example, <code>ConfigureAgent</code> can be used to tell an agent whether to profile or not and for how long to return profiling data. </p>
492
+
493
+ Args:
494
+ profiling_group_name: <p> The name of the profiling group for which the configured agent is collecting profiling data. </p>
495
+ fleet_instance_id: <p> A universally unique identifier (UUID) for a profiling instance. For example, if the profiling instance is an Amazon EC2 instance, it is the instance ID. If it is an AWS Fargate container, it is the container's task ID. </p>
496
+ metadata: <p> Metadata captured about the compute platform the agent is running on. It includes information about sampling and reporting. The valid fields are:</p> <ul> <li> <p> <code>COMPUTE_PLATFORM</code> - The compute platform on which the agent is running </p> </li> <li> <p> <code>AGENT_ID</code> - The ID for an agent instance. </p> </li> <li> <p> <code>AWS_REQUEST_ID</code> - The AWS request ID of a Lambda invocation. </p> </li> <li> <p> <code>EXECUTION_ENVIRONMENT</code> - The execution environment a Lambda function is running on. </p> </li> <li> <p> <code>LAMBDA_FUNCTION_ARN</code> - The Amazon Resource Name (ARN) that is used to invoke a Lambda function. </p> </li> <li> <p> <code>LAMBDA_MEMORY_LIMIT_IN_MB</code> - The memory allocated to a Lambda function. </p> </li> <li> <p> <code>LAMBDA_REMAINING_TIME_IN_MILLISECONDS</code> - The time in milliseconds before execution of a Lambda function times out. </p> </li> <li> <p> <code>LAMBDA_TIME_GAP_BETWEEN_INVOKES_IN_MILLISECONDS</code> - The time in milliseconds between two invocations of a Lambda function. </p> </li> <li> <p> <code>LAMBDA_PREVIOUS_EXECUTION_TIME_IN_MILLISECONDS</code> - The time in milliseconds for the previous Lambda invocation. </p> </li> </ul>
497
+
498
+ Raises:
499
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
500
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
501
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
502
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
503
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
504
+ """
505
+
506
+ def _handler(
507
+ req: "OperationRequest[capo_codeguruprofiler.types.configure_agent_request.ConfigureAgentRequest]",
508
+ ) -> OperationResponse[
509
+ "capo_codeguruprofiler.types.configure_agent_response.ConfigureAgentResponse"
510
+ ]:
511
+ import capo_codeguruprofiler._operations.code_guru_profiler.configure_agent
512
+
513
+ output, http_response = (
514
+ capo_codeguruprofiler._operations.code_guru_profiler.configure_agent.configure_agent(
515
+ req.options, req.input
516
+ )
517
+ )
518
+ return OperationResponse(output=output, response=http_response)
519
+
520
+ interceptors_, options_ = self._service.operation_options(config_overrides)
521
+ input_: capo_codeguruprofiler.types.configure_agent_request.ConfigureAgentRequest = {
522
+ "profiling_group_name": profiling_group_name
523
+ }
524
+ if fleet_instance_id is not None:
525
+ input_["fleet_instance_id"] = fleet_instance_id
526
+ if metadata is not None:
527
+ input_["metadata"] = metadata
528
+
529
+ response = execute_pipeline(
530
+ OperationRequest(input=input_, options=options_),
531
+ handler=_handler,
532
+ interceptors=list(interceptors_),
533
+ )
534
+ response.response.close()
535
+ return response.output
536
+
537
+ def get_notification_configuration(
538
+ self,
539
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
540
+ *,
541
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
542
+ ) -> "capo_codeguruprofiler.types.get_notification_configuration_response.GetNotificationConfigurationResponse":
543
+ """<p>Get the current configuration for anomaly notifications for a profiling group.</p>
544
+
545
+ Args:
546
+ profiling_group_name: <p>The name of the profiling group we want to get the notification configuration for.</p>
547
+
548
+ Raises:
549
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
550
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
551
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
552
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
553
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
554
+ """
555
+
556
+ def _handler(
557
+ req: "OperationRequest[capo_codeguruprofiler.types.get_notification_configuration_request.GetNotificationConfigurationRequest]",
558
+ ) -> OperationResponse[
559
+ "capo_codeguruprofiler.types.get_notification_configuration_response.GetNotificationConfigurationResponse"
560
+ ]:
561
+ import capo_codeguruprofiler._operations.code_guru_profiler.get_notification_configuration
562
+
563
+ output, http_response = (
564
+ capo_codeguruprofiler._operations.code_guru_profiler.get_notification_configuration.get_notification_configuration(
565
+ req.options, req.input
566
+ )
567
+ )
568
+ return OperationResponse(output=output, response=http_response)
569
+
570
+ interceptors_, options_ = self._service.operation_options(config_overrides)
571
+ input_: capo_codeguruprofiler.types.get_notification_configuration_request.GetNotificationConfigurationRequest = {
572
+ "profiling_group_name": profiling_group_name
573
+ }
574
+
575
+ response = execute_pipeline(
576
+ OperationRequest(input=input_, options=options_),
577
+ handler=_handler,
578
+ interceptors=list(interceptors_),
579
+ )
580
+ response.response.close()
581
+ return response.output
582
+
583
+ def get_policy(
584
+ self,
585
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
586
+ *,
587
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
588
+ ) -> "capo_codeguruprofiler.types.get_policy_response.GetPolicyResponse":
589
+ """<p> Returns the JSON-formatted resource-based policy on a profiling group. </p>
590
+
591
+ Args:
592
+ profiling_group_name: <p>The name of the profiling group.</p>
593
+
594
+ Raises:
595
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
596
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
597
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
598
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
599
+ """
600
+
601
+ def _handler(
602
+ req: "OperationRequest[capo_codeguruprofiler.types.get_policy_request.GetPolicyRequest]",
603
+ ) -> OperationResponse[
604
+ "capo_codeguruprofiler.types.get_policy_response.GetPolicyResponse"
605
+ ]:
606
+ import capo_codeguruprofiler._operations.code_guru_profiler.get_policy
607
+
608
+ output, http_response = (
609
+ capo_codeguruprofiler._operations.code_guru_profiler.get_policy.get_policy(
610
+ req.options, req.input
611
+ )
612
+ )
613
+ return OperationResponse(output=output, response=http_response)
614
+
615
+ interceptors_, options_ = self._service.operation_options(config_overrides)
616
+ input_: capo_codeguruprofiler.types.get_policy_request.GetPolicyRequest = {
617
+ "profiling_group_name": profiling_group_name
618
+ }
619
+
620
+ response = execute_pipeline(
621
+ OperationRequest(input=input_, options=options_),
622
+ handler=_handler,
623
+ interceptors=list(interceptors_),
624
+ )
625
+ response.response.close()
626
+ return response.output
627
+
628
+ def get_profile(
629
+ self,
630
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
631
+ *,
632
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
633
+ start_time: Optional["capo_codeguruprofiler.types.timestamp.Timestamp"] = None,
634
+ period: Optional["capo_codeguruprofiler.types.period.Period"] = None,
635
+ end_time: Optional["capo_codeguruprofiler.types.timestamp.Timestamp"] = None,
636
+ max_depth: Optional["capo_codeguruprofiler.types.max_depth.MaxDepth"] = None,
637
+ accept: Optional[str] = None,
638
+ ) -> "capo_codeguruprofiler.types.get_profile_response.GetProfileResponse":
639
+ r"""<p> Gets the aggregated profile of a profiling group for a specified time range. Amazon CodeGuru Profiler collects posted agent profiles for a profiling group into aggregated profiles. </p> <note> <p> Because aggregated profiles expire over time <code>GetProfile</code> is not idempotent. </p> </note> <p> Specify the time range for the requested aggregated profile using 1 or 2 of the following parameters: <code>startTime</code>, <code>endTime</code>, <code>period</code>. The maximum time range allowed is 7 days. If you specify all 3 parameters, an exception is thrown. If you specify only <code>period</code>, the latest aggregated profile is returned. </p> <p> Aggregated profiles are available with aggregation periods of 5 minutes, 1 hour, and 1 day, aligned to UTC. The aggregation period of an aggregated profile determines how long it is retained. For more information, see <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_AggregatedProfileTime.html\"> <code>AggregatedProfileTime</code> </a>. The aggregated profile's aggregation period determines how long it is retained by CodeGuru Profiler. </p> <ul> <li> <p> If the aggregation period is 5 minutes, the aggregated profile is retained for 15 days. </p> </li> <li> <p> If the aggregation period is 1 hour, the aggregated profile is retained for 60 days. </p> </li> <li> <p> If the aggregation period is 1 day, the aggregated profile is retained for 3 years. </p> </li> </ul> <p>There are two use cases for calling <code>GetProfile</code>.</p> <ol> <li> <p> If you want to return an aggregated profile that already exists, use <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ListProfileTimes.html\"> <code>ListProfileTimes</code> </a> to view the time ranges of existing aggregated profiles. Use them in a <code>GetProfile</code> request to return a specific, existing aggregated profile. </p> </li> <li> <p> If you want to return an aggregated profile for a time range that doesn't align with an existing aggregated profile, then CodeGuru Profiler makes a best effort to combine existing aggregated profiles from the requested time range and return them as one aggregated profile. </p> <p> If aggregated profiles do not exist for the full time range requested, then aggregated profiles for a smaller time range are returned. For example, if the requested time range is from 00:00 to 00:20, and the existing aggregated profiles are from 00:15 and 00:25, then the aggregated profiles from 00:15 to 00:20 are returned. </p> </li> </ol>
640
+
641
+ Args:
642
+ profiling_group_name: <p>The name of the profiling group to get.</p>
643
+ start_time: <p>The start time of the profile to get. Specify using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p> <p> If you specify <code>startTime</code>, then you must also specify <code>period</code> or <code>endTime</code>, but not both. </p>
644
+ period: <p> Used with <code>startTime</code> or <code>endTime</code> to specify the time range for the returned aggregated profile. Specify using the ISO 8601 format. For example, <code>P1DT1H1M1S</code>. </p> <p> To get the latest aggregated profile, specify only <code>period</code>. </p>
645
+ end_time: <p> The end time of the requested profile. Specify using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p> <p> If you specify <code>endTime</code>, then you must also specify <code>period</code> or <code>startTime</code>, but not both. </p>
646
+ max_depth: <p> The maximum depth of the stacks in the code that is represented in the aggregated profile. For example, if CodeGuru Profiler finds a method <code>A</code>, which calls method <code>B</code>, which calls method <code>C</code>, which calls method <code>D</code>, then the depth is 4. If the <code>maxDepth</code> is set to 2, then the aggregated profile contains representations of methods <code>A</code> and <code>B</code>. </p>
647
+ accept: <p> The format of the returned profiling data. The format maps to the <code>Accept</code> and <code>Content-Type</code> headers of the HTTP request. You can specify one of the following: or the default . </p> <ul> <li> <p> <code>application/json</code> — standard JSON format </p> </li> <li> <p> <code>application/x-amzn-ion</code> — the Amazon Ion data format. For more information, see <a href=\"http://amzn.github.io/ion-docs/\">Amazon Ion</a>. </p> </li> </ul>
648
+
649
+ Raises:
650
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
651
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
652
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
653
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
654
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
655
+ """
656
+
657
+ def _handler(
658
+ req: "OperationRequest[capo_codeguruprofiler.types.get_profile_request.GetProfileRequest]",
659
+ ) -> OperationResponse[
660
+ "capo_codeguruprofiler.types.get_profile_response.GetProfileResponse"
661
+ ]:
662
+ import capo_codeguruprofiler._operations.code_guru_profiler.get_profile
663
+
664
+ output, http_response = (
665
+ capo_codeguruprofiler._operations.code_guru_profiler.get_profile.get_profile(
666
+ req.options, req.input
667
+ )
668
+ )
669
+ return OperationResponse(output=output, response=http_response)
670
+
671
+ interceptors_, options_ = self._service.operation_options(config_overrides)
672
+ input_: capo_codeguruprofiler.types.get_profile_request.GetProfileRequest = {
673
+ "profiling_group_name": profiling_group_name
674
+ }
675
+ if start_time is not None:
676
+ input_["start_time"] = start_time
677
+ if period is not None:
678
+ input_["period"] = period
679
+ if end_time is not None:
680
+ input_["end_time"] = end_time
681
+ if max_depth is not None:
682
+ input_["max_depth"] = max_depth
683
+ if accept is not None:
684
+ input_["accept"] = accept
685
+
686
+ response = execute_pipeline(
687
+ OperationRequest(input=input_, options=options_),
688
+ handler=_handler,
689
+ interceptors=list(interceptors_),
690
+ )
691
+ response.response.close()
692
+ return response.output
693
+
694
+ def get_recommendations(
695
+ self,
696
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
697
+ start_time: "capo_codeguruprofiler.types.timestamp.Timestamp",
698
+ end_time: "capo_codeguruprofiler.types.timestamp.Timestamp",
699
+ *,
700
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
701
+ locale: Optional["capo_codeguruprofiler.types.locale.Locale"] = None,
702
+ ) -> "capo_codeguruprofiler.types.get_recommendations_response.GetRecommendationsResponse":
703
+ r"""<p> Returns a list of <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_Recommendation.html\"> <code>Recommendation</code> </a> objects that contain recommendations for a profiling group for a given time period. A list of <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_Anomaly.html\"> <code>Anomaly</code> </a> objects that contains details about anomalies detected in the profiling group for the same time period is also returned. </p>
704
+
705
+ Args:
706
+ profiling_group_name: <p> The name of the profiling group to get analysis data about. </p>
707
+ start_time: <p> The end time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
708
+ end_time: <p> The start time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
709
+ locale: <p> The language used to provide analysis. Specify using a string that is one of the following <code>BCP 47</code> language codes. </p> <ul> <li> <p> <code>de-DE</code> - German, Germany </p> </li> <li> <p> <code>en-GB</code> - English, United Kingdom </p> </li> <li> <p> <code>en-US</code> - English, United States </p> </li> <li> <p> <code>es-ES</code> - Spanish, Spain </p> </li> <li> <p> <code>fr-FR</code> - French, France </p> </li> <li> <p> <code>it-IT</code> - Italian, Italy </p> </li> <li> <p> <code>ja-JP</code> - Japanese, Japan </p> </li> <li> <p> <code>ko-KR</code> - Korean, Republic of Korea </p> </li> <li> <p> <code>pt-BR</code> - Portugese, Brazil </p> </li> <li> <p> <code>zh-CN</code> - Chinese, China </p> </li> <li> <p> <code>zh-TW</code> - Chinese, Taiwan </p> </li> </ul>
710
+
711
+ Raises:
712
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
713
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
714
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
715
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
716
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
717
+ """
718
+
719
+ def _handler(
720
+ req: "OperationRequest[capo_codeguruprofiler.types.get_recommendations_request.GetRecommendationsRequest]",
721
+ ) -> OperationResponse[
722
+ "capo_codeguruprofiler.types.get_recommendations_response.GetRecommendationsResponse"
723
+ ]:
724
+ import capo_codeguruprofiler._operations.code_guru_profiler.get_recommendations
725
+
726
+ output, http_response = (
727
+ capo_codeguruprofiler._operations.code_guru_profiler.get_recommendations.get_recommendations(
728
+ req.options, req.input
729
+ )
730
+ )
731
+ return OperationResponse(output=output, response=http_response)
732
+
733
+ interceptors_, options_ = self._service.operation_options(config_overrides)
734
+ input_: capo_codeguruprofiler.types.get_recommendations_request.GetRecommendationsRequest = {
735
+ "profiling_group_name": profiling_group_name,
736
+ "start_time": start_time,
737
+ "end_time": end_time,
738
+ }
739
+ if locale is not None:
740
+ input_["locale"] = locale
741
+
742
+ response = execute_pipeline(
743
+ OperationRequest(input=input_, options=options_),
744
+ handler=_handler,
745
+ interceptors=list(interceptors_),
746
+ )
747
+ response.response.close()
748
+ return response.output
749
+
750
+ def list_findings_reports(
751
+ self,
752
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
753
+ start_time: "capo_codeguruprofiler.types.timestamp.Timestamp",
754
+ end_time: "capo_codeguruprofiler.types.timestamp.Timestamp",
755
+ *,
756
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
757
+ next_token: Optional[
758
+ "capo_codeguruprofiler.types.pagination_token.PaginationToken"
759
+ ] = None,
760
+ max_results: Optional[
761
+ "capo_codeguruprofiler.types.max_results.MaxResults"
762
+ ] = None,
763
+ daily_reports_only: Optional[bool] = None,
764
+ ) -> "capo_codeguruprofiler.types.list_findings_reports_response.ListFindingsReportsResponse":
765
+ """<p>List the available reports for a given profiling group and time range.</p>
766
+
767
+ Args:
768
+ profiling_group_name: <p>The name of the profiling group from which to search for analysis data.</p>
769
+ start_time: <p> The start time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
770
+ end_time: <p> The end time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
771
+ next_token: <p>The <code>nextToken</code> value returned from a previous paginated <code>ListFindingsReportsRequest</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. </p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>
772
+ max_results: <p>The maximum number of report results returned by <code>ListFindingsReports</code> in paginated output. When this parameter is used, <code>ListFindingsReports</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListFindingsReports</code> request with the returned <code>nextToken</code> value.</p>
773
+ daily_reports_only: <p>A <code>Boolean</code> value indicating whether to only return reports from daily profiles. If set to <code>True</code>, only analysis data from daily profiles is returned. If set to <code>False</code>, analysis data is returned from smaller time windows (for example, one hour).</p>
774
+
775
+ Raises:
776
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
777
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
778
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
779
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
780
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
781
+ """
782
+
783
+ def _handler(
784
+ req: "OperationRequest[capo_codeguruprofiler.types.list_findings_reports_request.ListFindingsReportsRequest]",
785
+ ) -> OperationResponse[
786
+ "capo_codeguruprofiler.types.list_findings_reports_response.ListFindingsReportsResponse"
787
+ ]:
788
+ import capo_codeguruprofiler._operations.code_guru_profiler.list_findings_reports
789
+
790
+ output, http_response = (
791
+ capo_codeguruprofiler._operations.code_guru_profiler.list_findings_reports.list_findings_reports(
792
+ req.options, req.input
793
+ )
794
+ )
795
+ return OperationResponse(output=output, response=http_response)
796
+
797
+ interceptors_, options_ = self._service.operation_options(config_overrides)
798
+ input_: capo_codeguruprofiler.types.list_findings_reports_request.ListFindingsReportsRequest = {
799
+ "profiling_group_name": profiling_group_name,
800
+ "start_time": start_time,
801
+ "end_time": end_time,
802
+ }
803
+ if next_token is not None:
804
+ input_["next_token"] = next_token
805
+ if max_results is not None:
806
+ input_["max_results"] = max_results
807
+ if daily_reports_only is not None:
808
+ input_["daily_reports_only"] = daily_reports_only
809
+
810
+ response = execute_pipeline(
811
+ OperationRequest(input=input_, options=options_),
812
+ handler=_handler,
813
+ interceptors=list(interceptors_),
814
+ )
815
+ response.response.close()
816
+ return response.output
817
+
818
+ def list_profile_times(
819
+ self,
820
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
821
+ start_time: "capo_codeguruprofiler.types.timestamp.Timestamp",
822
+ end_time: "capo_codeguruprofiler.types.timestamp.Timestamp",
823
+ period: "capo_codeguruprofiler.types.aggregation_period.AggregationPeriod",
824
+ *,
825
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
826
+ order_by: Optional["capo_codeguruprofiler.types.order_by.OrderBy"] = None,
827
+ max_results: Optional[
828
+ "capo_codeguruprofiler.types.max_results.MaxResults"
829
+ ] = None,
830
+ next_token: Optional[
831
+ "capo_codeguruprofiler.types.pagination_token.PaginationToken"
832
+ ] = None,
833
+ ) -> "capo_codeguruprofiler.types.list_profile_times_response.ListProfileTimesResponse":
834
+ """<p>Lists the start times of the available aggregated profiles of a profiling group for an aggregation period within the specified time range.</p>
835
+
836
+ Args:
837
+ profiling_group_name: <p>The name of the profiling group.</p>
838
+ start_time: <p>The start time of the time range from which to list the profiles.</p>
839
+ end_time: <p>The end time of the time range from which to list the profiles.</p>
840
+ period: <p> The aggregation period. This specifies the period during which an aggregation profile collects posted agent profiles for a profiling group. There are 3 valid values. </p> <ul> <li> <p> <code>P1D</code> — 1 day </p> </li> <li> <p> <code>PT1H</code> — 1 hour </p> </li> <li> <p> <code>PT5M</code> — 5 minutes </p> </li> </ul>
841
+ order_by: <p>The order (ascending or descending by start time of the profile) to use when listing profiles. Defaults to <code>TIMESTAMP_DESCENDING</code>. </p>
842
+ max_results: <p>The maximum number of profile time results returned by <code>ListProfileTimes</code> in paginated output. When this parameter is used, <code>ListProfileTimes</code> only returns <code>maxResults</code> results in a single page with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListProfileTimes</code> request with the returned <code>nextToken</code> value. </p>
843
+ next_token: <p>The <code>nextToken</code> value returned from a previous paginated <code>ListProfileTimes</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. </p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>
844
+
845
+ Raises:
846
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
847
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
848
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
849
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
850
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
851
+ """
852
+
853
+ def _handler(
854
+ req: "OperationRequest[capo_codeguruprofiler.types.list_profile_times_request.ListProfileTimesRequest]",
855
+ ) -> OperationResponse[
856
+ "capo_codeguruprofiler.types.list_profile_times_response.ListProfileTimesResponse"
857
+ ]:
858
+ import capo_codeguruprofiler._operations.code_guru_profiler.list_profile_times
859
+
860
+ output, http_response = (
861
+ capo_codeguruprofiler._operations.code_guru_profiler.list_profile_times.list_profile_times(
862
+ req.options, req.input
863
+ )
864
+ )
865
+ return OperationResponse(output=output, response=http_response)
866
+
867
+ interceptors_, options_ = self._service.operation_options(config_overrides)
868
+ input_: capo_codeguruprofiler.types.list_profile_times_request.ListProfileTimesRequest = {
869
+ "profiling_group_name": profiling_group_name,
870
+ "start_time": start_time,
871
+ "end_time": end_time,
872
+ "period": period,
873
+ }
874
+ if order_by is not None:
875
+ input_["order_by"] = order_by
876
+ if max_results is not None:
877
+ input_["max_results"] = max_results
878
+ if next_token is not None:
879
+ input_["next_token"] = next_token
880
+
881
+ response = execute_pipeline(
882
+ OperationRequest(input=input_, options=options_),
883
+ handler=_handler,
884
+ interceptors=list(interceptors_),
885
+ )
886
+ response.response.close()
887
+ return response.output
888
+
889
+ def post_agent_profile(
890
+ self,
891
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
892
+ agent_profile: "capo_codeguruprofiler.types.agent_profile.AgentProfile",
893
+ content_type: str,
894
+ *,
895
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
896
+ profile_token: Optional[
897
+ "capo_codeguruprofiler.types.client_token.ClientToken"
898
+ ] = None,
899
+ ) -> "capo_codeguruprofiler.types.post_agent_profile_response.PostAgentProfileResponse":
900
+ r"""<p> Submits profiling data to an aggregated profile of a profiling group. To get an aggregated profile that is created with this profiling data, use <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_GetProfile.html\"> <code>GetProfile</code> </a>. </p>
901
+
902
+ Args:
903
+ profiling_group_name: <p> The name of the profiling group with the aggregated profile that receives the submitted profiling data. </p>
904
+ agent_profile: <p> The submitted profiling data. </p>
905
+ profile_token: <p> Amazon CodeGuru Profiler uses this universally unique identifier (UUID) to prevent the accidental submission of duplicate profiling data if there are failures and retries. </p>
906
+ content_type: <p> The format of the submitted profiling data. The format maps to the <code>Accept</code> and <code>Content-Type</code> headers of the HTTP request. You can specify one of the following: or the default . </p> <ul> <li> <p> <code>application/json</code> — standard JSON format </p> </li> <li> <p> <code>application/x-amzn-ion</code> — the Amazon Ion data format. For more information, see <a href=\"http://amzn.github.io/ion-docs/\">Amazon Ion</a>. </p> </li> </ul>
907
+
908
+ Raises:
909
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
910
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
911
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
912
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
913
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
914
+ """
915
+
916
+ def _handler(
917
+ req: "OperationRequest[capo_codeguruprofiler.types.post_agent_profile_request.PostAgentProfileRequest]",
918
+ ) -> OperationResponse[
919
+ "capo_codeguruprofiler.types.post_agent_profile_response.PostAgentProfileResponse"
920
+ ]:
921
+ import capo_codeguruprofiler._operations.code_guru_profiler.post_agent_profile
922
+
923
+ output, http_response = (
924
+ capo_codeguruprofiler._operations.code_guru_profiler.post_agent_profile.post_agent_profile(
925
+ req.options, req.input
926
+ )
927
+ )
928
+ return OperationResponse(output=output, response=http_response)
929
+
930
+ interceptors_, options_ = self._service.operation_options(config_overrides)
931
+ input_: capo_codeguruprofiler.types.post_agent_profile_request.PostAgentProfileRequest = {
932
+ "profiling_group_name": profiling_group_name,
933
+ "agent_profile": agent_profile,
934
+ "content_type": content_type,
935
+ }
936
+ if profile_token is None:
937
+ profile_token = str(uuid.uuid4())
938
+ input_["profile_token"] = profile_token
939
+
940
+ response = execute_pipeline(
941
+ OperationRequest(input=input_, options=options_),
942
+ handler=_handler,
943
+ interceptors=list(interceptors_),
944
+ )
945
+ response.response.close()
946
+ return response.output
947
+
948
+ def put_permission(
949
+ self,
950
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
951
+ action_group: "capo_codeguruprofiler.types.action_group.ActionGroup",
952
+ principals: "capo_codeguruprofiler.types.principals.Principals",
953
+ *,
954
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
955
+ revision_id: Optional[
956
+ "capo_codeguruprofiler.types.revision_id.RevisionId"
957
+ ] = None,
958
+ ) -> "capo_codeguruprofiler.types.put_permission_response.PutPermissionResponse":
959
+ r"""<p> Adds permissions to a profiling group's resource-based policy that are provided using an action group. If a profiling group doesn't have a resource-based policy, one is created for it using the permissions in the action group and the roles and users in the <code>principals</code> parameter. </p> <p> The one supported action group that can be added is <code>agentPermission</code> which grants <code>ConfigureAgent</code> and <code>PostAgent</code> permissions. For more information, see <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-ug/resource-based-policies.html\">Resource-based policies in CodeGuru Profiler</a> in the <i>Amazon CodeGuru Profiler User Guide</i>, <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ConfigureAgent.html\"> <code>ConfigureAgent</code> </a>, and <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_PostAgentProfile.html\"> <code>PostAgentProfile</code> </a>. </p> <p> The first time you call <code>PutPermission</code> on a profiling group, do not specify a <code>revisionId</code> because it doesn't have a resource-based policy. Subsequent calls must provide a <code>revisionId</code> to specify which revision of the resource-based policy to add the permissions to. </p> <p> The response contains the profiling group's JSON-formatted resource policy. </p>
960
+
961
+ Args:
962
+ profiling_group_name: <p>The name of the profiling group to grant access to.</p>
963
+ action_group: <p> Specifies an action group that contains permissions to add to a profiling group resource. One action group is supported, <code>agentPermissions</code>, which grants permission to perform actions required by the profiling agent, <code>ConfigureAgent</code> and <code>PostAgentProfile</code> permissions. </p>
964
+ principals: <p> A list ARNs for the roles and users you want to grant access to the profiling group. Wildcards are not are supported in the ARNs. </p>
965
+ revision_id: <p> A universally unique identifier (UUID) for the revision of the policy you are adding to the profiling group. Do not specify this when you add permissions to a profiling group for the first time. If a policy already exists on the profiling group, you must specify the <code>revisionId</code>. </p>
966
+
967
+ Raises:
968
+ capo_codeguruprofiler.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
969
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
970
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
971
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
972
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
973
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
974
+ """
975
+
976
+ def _handler(
977
+ req: "OperationRequest[capo_codeguruprofiler.types.put_permission_request.PutPermissionRequest]",
978
+ ) -> OperationResponse[
979
+ "capo_codeguruprofiler.types.put_permission_response.PutPermissionResponse"
980
+ ]:
981
+ import capo_codeguruprofiler._operations.code_guru_profiler.put_permission
982
+
983
+ output, http_response = (
984
+ capo_codeguruprofiler._operations.code_guru_profiler.put_permission.put_permission(
985
+ req.options, req.input
986
+ )
987
+ )
988
+ return OperationResponse(output=output, response=http_response)
989
+
990
+ interceptors_, options_ = self._service.operation_options(config_overrides)
991
+ input_: capo_codeguruprofiler.types.put_permission_request.PutPermissionRequest = {
992
+ "profiling_group_name": profiling_group_name,
993
+ "action_group": action_group,
994
+ "principals": principals,
995
+ }
996
+ if revision_id is not None:
997
+ input_["revision_id"] = revision_id
998
+
999
+ response = execute_pipeline(
1000
+ OperationRequest(input=input_, options=options_),
1001
+ handler=_handler,
1002
+ interceptors=list(interceptors_),
1003
+ )
1004
+ response.response.close()
1005
+ return response.output
1006
+
1007
+ def remove_notification_channel(
1008
+ self,
1009
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1010
+ channel_id: "capo_codeguruprofiler.types.channel_id.ChannelId",
1011
+ *,
1012
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
1013
+ ) -> "capo_codeguruprofiler.types.remove_notification_channel_response.RemoveNotificationChannelResponse":
1014
+ """<p>Remove one anomaly notifications channel for a profiling group.</p>
1015
+
1016
+ Args:
1017
+ profiling_group_name: <p>The name of the profiling group we want to change notification configuration for.</p>
1018
+ channel_id: <p>The id of the channel that we want to stop receiving notifications.</p>
1019
+
1020
+ Raises:
1021
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1022
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
1023
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1024
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
1025
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1026
+ """
1027
+
1028
+ def _handler(
1029
+ req: "OperationRequest[capo_codeguruprofiler.types.remove_notification_channel_request.RemoveNotificationChannelRequest]",
1030
+ ) -> OperationResponse[
1031
+ "capo_codeguruprofiler.types.remove_notification_channel_response.RemoveNotificationChannelResponse"
1032
+ ]:
1033
+ import capo_codeguruprofiler._operations.code_guru_profiler.remove_notification_channel
1034
+
1035
+ output, http_response = (
1036
+ capo_codeguruprofiler._operations.code_guru_profiler.remove_notification_channel.remove_notification_channel(
1037
+ req.options, req.input
1038
+ )
1039
+ )
1040
+ return OperationResponse(output=output, response=http_response)
1041
+
1042
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1043
+ input_: capo_codeguruprofiler.types.remove_notification_channel_request.RemoveNotificationChannelRequest = {
1044
+ "profiling_group_name": profiling_group_name,
1045
+ "channel_id": channel_id,
1046
+ }
1047
+
1048
+ response = execute_pipeline(
1049
+ OperationRequest(input=input_, options=options_),
1050
+ handler=_handler,
1051
+ interceptors=list(interceptors_),
1052
+ )
1053
+ response.response.close()
1054
+ return response.output
1055
+
1056
+ def remove_permission(
1057
+ self,
1058
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1059
+ action_group: "capo_codeguruprofiler.types.action_group.ActionGroup",
1060
+ revision_id: "capo_codeguruprofiler.types.revision_id.RevisionId",
1061
+ *,
1062
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
1063
+ ) -> "capo_codeguruprofiler.types.remove_permission_response.RemovePermissionResponse":
1064
+ r"""<p> Removes permissions from a profiling group's resource-based policy that are provided using an action group. The one supported action group that can be removed is <code>agentPermission</code> which grants <code>ConfigureAgent</code> and <code>PostAgent</code> permissions. For more information, see <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-ug/resource-based-policies.html\">Resource-based policies in CodeGuru Profiler</a> in the <i>Amazon CodeGuru Profiler User Guide</i>, <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ConfigureAgent.html\"> <code>ConfigureAgent</code> </a>, and <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_PostAgentProfile.html\"> <code>PostAgentProfile</code> </a>. </p>
1065
+
1066
+ Args:
1067
+ profiling_group_name: <p>The name of the profiling group.</p>
1068
+ action_group: <p> Specifies an action group that contains the permissions to remove from a profiling group's resource-based policy. One action group is supported, <code>agentPermissions</code>, which grants <code>ConfigureAgent</code> and <code>PostAgentProfile</code> permissions. </p>
1069
+ revision_id: <p> A universally unique identifier (UUID) for the revision of the resource-based policy from which you want to remove permissions. </p>
1070
+
1071
+ Raises:
1072
+ capo_codeguruprofiler.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
1073
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1074
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
1075
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1076
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
1077
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1078
+ """
1079
+
1080
+ def _handler(
1081
+ req: "OperationRequest[capo_codeguruprofiler.types.remove_permission_request.RemovePermissionRequest]",
1082
+ ) -> OperationResponse[
1083
+ "capo_codeguruprofiler.types.remove_permission_response.RemovePermissionResponse"
1084
+ ]:
1085
+ import capo_codeguruprofiler._operations.code_guru_profiler.remove_permission
1086
+
1087
+ output, http_response = (
1088
+ capo_codeguruprofiler._operations.code_guru_profiler.remove_permission.remove_permission(
1089
+ req.options, req.input
1090
+ )
1091
+ )
1092
+ return OperationResponse(output=output, response=http_response)
1093
+
1094
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1095
+ input_: capo_codeguruprofiler.types.remove_permission_request.RemovePermissionRequest = {
1096
+ "profiling_group_name": profiling_group_name,
1097
+ "action_group": action_group,
1098
+ "revision_id": revision_id,
1099
+ }
1100
+
1101
+ response = execute_pipeline(
1102
+ OperationRequest(input=input_, options=options_),
1103
+ handler=_handler,
1104
+ interceptors=list(interceptors_),
1105
+ )
1106
+ response.response.close()
1107
+ return response.output
1108
+
1109
+ def submit_feedback(
1110
+ self,
1111
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1112
+ anomaly_instance_id: "capo_codeguruprofiler.types.anomaly_instance_id.AnomalyInstanceId",
1113
+ type: "capo_codeguruprofiler.types.feedback_type.FeedbackType",
1114
+ *,
1115
+ config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
1116
+ comment: Optional[str] = None,
1117
+ ) -> "capo_codeguruprofiler.types.submit_feedback_response.SubmitFeedbackResponse":
1118
+ r"""<p>Sends feedback to CodeGuru Profiler about whether the anomaly detected by the analysis is useful or not.</p>
1119
+
1120
+ Args:
1121
+ profiling_group_name: <p>The name of the profiling group that is associated with the analysis data.</p>
1122
+ anomaly_instance_id: <p>The universally unique identifier (UUID) of the <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_AnomalyInstance.html\"> <code>AnomalyInstance</code> </a> object that is included in the analysis data.</p>
1123
+ type: <p> The feedback tpye. Thee are two valid values, <code>Positive</code> and <code>Negative</code>. </p>
1124
+ comment: <p>Optional feedback about this anomaly.</p>
1125
+
1126
+ Raises:
1127
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1128
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
1129
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1130
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
1131
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1132
+ """
1133
+
1134
+ def _handler(
1135
+ req: "OperationRequest[capo_codeguruprofiler.types.submit_feedback_request.SubmitFeedbackRequest]",
1136
+ ) -> OperationResponse[
1137
+ "capo_codeguruprofiler.types.submit_feedback_response.SubmitFeedbackResponse"
1138
+ ]:
1139
+ import capo_codeguruprofiler._operations.code_guru_profiler.submit_feedback
1140
+
1141
+ output, http_response = (
1142
+ capo_codeguruprofiler._operations.code_guru_profiler.submit_feedback.submit_feedback(
1143
+ req.options, req.input
1144
+ )
1145
+ )
1146
+ return OperationResponse(output=output, response=http_response)
1147
+
1148
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1149
+ input_: capo_codeguruprofiler.types.submit_feedback_request.SubmitFeedbackRequest = {
1150
+ "profiling_group_name": profiling_group_name,
1151
+ "anomaly_instance_id": anomaly_instance_id,
1152
+ "type": type,
1153
+ }
1154
+ if comment is not None:
1155
+ input_["comment"] = comment
1156
+
1157
+ response = execute_pipeline(
1158
+ OperationRequest(input=input_, options=options_),
1159
+ handler=_handler,
1160
+ interceptors=list(interceptors_),
1161
+ )
1162
+ response.response.close()
1163
+ return response.output
1164
+
1165
+
1166
+ class AsyncProfilingGroup:
1167
+ def __init__(self, service: AsyncCodeGuruProfilerClient) -> None:
1168
+ self._service = service
1169
+
1170
+ async def put(
1171
+ self,
1172
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1173
+ client_token: "capo_codeguruprofiler.types.client_token.ClientToken",
1174
+ *,
1175
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
1176
+ compute_platform: Optional[
1177
+ "capo_codeguruprofiler.types.compute_platform.ComputePlatform"
1178
+ ] = None,
1179
+ agent_orchestration_config: Optional[
1180
+ "capo_codeguruprofiler.types.agent_orchestration_config.AgentOrchestrationConfig"
1181
+ ] = None,
1182
+ tags: Optional["capo_codeguruprofiler.types.tags_map.TagsMap"] = None,
1183
+ ) -> "capo_codeguruprofiler.types.create_profiling_group_response.CreateProfilingGroupResponse":
1184
+ """<p>Creates a profiling group.</p>
1185
+
1186
+ Args:
1187
+ profiling_group_name: <p>The name of the profiling group to create.</p>
1188
+ compute_platform: <p> The compute platform of the profiling group. Use <code>AWSLambda</code> if your application runs on AWS Lambda. Use <code>Default</code> if your application runs on a compute platform that is not AWS Lambda, such an Amazon EC2 instance, an on-premises server, or a different platform. If not specified, <code>Default</code> is used. </p>
1189
+ client_token: <p> Amazon CodeGuru Profiler uses this universally unique identifier (UUID) to prevent the accidental creation of duplicate profiling groups if there are failures and retries. </p>
1190
+ agent_orchestration_config: <p> Specifies whether profiling is enabled or disabled for the created profiling group. </p>
1191
+ tags: <p> A list of tags to add to the created profiling group. </p>
1192
+
1193
+ Raises:
1194
+ capo_codeguruprofiler.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
1195
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1196
+ capo_codeguruprofiler.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use <a href=\"https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html\">Service Quotas</a> to request a service quota increase. </p>
1197
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1198
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
1199
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1200
+ """
1201
+
1202
+ async def _handler(
1203
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.create_profiling_group_request.CreateProfilingGroupRequest]",
1204
+ ) -> AsyncOperationResponse[
1205
+ "capo_codeguruprofiler.types.create_profiling_group_response.CreateProfilingGroupResponse"
1206
+ ]:
1207
+ import capo_codeguruprofiler._operations.code_guru_profiler.create_profiling_group
1208
+
1209
+ (
1210
+ output,
1211
+ http_response,
1212
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.create_profiling_group.async_create_profiling_group(
1213
+ req.options, req.input
1214
+ )
1215
+ return AsyncOperationResponse(output=output, response=http_response)
1216
+
1217
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1218
+ input_: capo_codeguruprofiler.types.create_profiling_group_request.CreateProfilingGroupRequest = {
1219
+ "profiling_group_name": profiling_group_name,
1220
+ "client_token": client_token,
1221
+ }
1222
+ if compute_platform is not None:
1223
+ input_["compute_platform"] = compute_platform
1224
+ if agent_orchestration_config is not None:
1225
+ input_["agent_orchestration_config"] = agent_orchestration_config
1226
+ if tags is not None:
1227
+ input_["tags"] = tags
1228
+
1229
+ response = await aexecute_pipeline(
1230
+ AsyncOperationRequest(input=input_, options=options_),
1231
+ handler=_handler,
1232
+ interceptors=list(interceptors_),
1233
+ )
1234
+ await response.response.aclose()
1235
+ return response.output
1236
+
1237
+ async def read(
1238
+ self,
1239
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1240
+ *,
1241
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
1242
+ ) -> "capo_codeguruprofiler.types.describe_profiling_group_response.DescribeProfilingGroupResponse":
1243
+ r"""<p> Returns a <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html\"> <code>ProfilingGroupDescription</code> </a> object that contains information about the requested profiling group. </p>
1244
+
1245
+ Args:
1246
+ profiling_group_name: <p> The name of the profiling group to get information about. </p>
1247
+
1248
+ Raises:
1249
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1250
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
1251
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1252
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
1253
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1254
+ """
1255
+
1256
+ async def _handler(
1257
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.describe_profiling_group_request.DescribeProfilingGroupRequest]",
1258
+ ) -> AsyncOperationResponse[
1259
+ "capo_codeguruprofiler.types.describe_profiling_group_response.DescribeProfilingGroupResponse"
1260
+ ]:
1261
+ import capo_codeguruprofiler._operations.code_guru_profiler.describe_profiling_group
1262
+
1263
+ (
1264
+ output,
1265
+ http_response,
1266
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.describe_profiling_group.async_describe_profiling_group(
1267
+ req.options, req.input
1268
+ )
1269
+ return AsyncOperationResponse(output=output, response=http_response)
1270
+
1271
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1272
+ input_: capo_codeguruprofiler.types.describe_profiling_group_request.DescribeProfilingGroupRequest = {
1273
+ "profiling_group_name": profiling_group_name
1274
+ }
1275
+
1276
+ response = await aexecute_pipeline(
1277
+ AsyncOperationRequest(input=input_, options=options_),
1278
+ handler=_handler,
1279
+ interceptors=list(interceptors_),
1280
+ )
1281
+ await response.response.aclose()
1282
+ return response.output
1283
+
1284
+ async def update(
1285
+ self,
1286
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1287
+ agent_orchestration_config: "capo_codeguruprofiler.types.agent_orchestration_config.AgentOrchestrationConfig",
1288
+ *,
1289
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
1290
+ ) -> "capo_codeguruprofiler.types.update_profiling_group_response.UpdateProfilingGroupResponse":
1291
+ """<p>Updates a profiling group.</p>
1292
+
1293
+ Args:
1294
+ profiling_group_name: <p>The name of the profiling group to update.</p>
1295
+ agent_orchestration_config: <p> Specifies whether profiling is enabled or disabled for a profiling group. </p>
1296
+
1297
+ Raises:
1298
+ capo_codeguruprofiler.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
1299
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1300
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
1301
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1302
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
1303
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1304
+ """
1305
+
1306
+ async def _handler(
1307
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.update_profiling_group_request.UpdateProfilingGroupRequest]",
1308
+ ) -> AsyncOperationResponse[
1309
+ "capo_codeguruprofiler.types.update_profiling_group_response.UpdateProfilingGroupResponse"
1310
+ ]:
1311
+ import capo_codeguruprofiler._operations.code_guru_profiler.update_profiling_group
1312
+
1313
+ (
1314
+ output,
1315
+ http_response,
1316
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.update_profiling_group.async_update_profiling_group(
1317
+ req.options, req.input
1318
+ )
1319
+ return AsyncOperationResponse(output=output, response=http_response)
1320
+
1321
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1322
+ input_: capo_codeguruprofiler.types.update_profiling_group_request.UpdateProfilingGroupRequest = {
1323
+ "profiling_group_name": profiling_group_name,
1324
+ "agent_orchestration_config": agent_orchestration_config,
1325
+ }
1326
+
1327
+ response = await aexecute_pipeline(
1328
+ AsyncOperationRequest(input=input_, options=options_),
1329
+ handler=_handler,
1330
+ interceptors=list(interceptors_),
1331
+ )
1332
+ await response.response.aclose()
1333
+ return response.output
1334
+
1335
+ async def delete(
1336
+ self,
1337
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1338
+ *,
1339
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
1340
+ ) -> "capo_codeguruprofiler.types.delete_profiling_group_response.DeleteProfilingGroupResponse":
1341
+ """<p>Deletes a profiling group.</p>
1342
+
1343
+ Args:
1344
+ profiling_group_name: <p>The name of the profiling group to delete.</p>
1345
+
1346
+ Raises:
1347
+ capo_codeguruprofiler.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
1348
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1349
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
1350
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1351
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
1352
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1353
+ """
1354
+
1355
+ async def _handler(
1356
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.delete_profiling_group_request.DeleteProfilingGroupRequest]",
1357
+ ) -> AsyncOperationResponse[
1358
+ "capo_codeguruprofiler.types.delete_profiling_group_response.DeleteProfilingGroupResponse"
1359
+ ]:
1360
+ import capo_codeguruprofiler._operations.code_guru_profiler.delete_profiling_group
1361
+
1362
+ (
1363
+ output,
1364
+ http_response,
1365
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.delete_profiling_group.async_delete_profiling_group(
1366
+ req.options, req.input
1367
+ )
1368
+ return AsyncOperationResponse(output=output, response=http_response)
1369
+
1370
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1371
+ input_: capo_codeguruprofiler.types.delete_profiling_group_request.DeleteProfilingGroupRequest = {
1372
+ "profiling_group_name": profiling_group_name
1373
+ }
1374
+
1375
+ response = await aexecute_pipeline(
1376
+ AsyncOperationRequest(input=input_, options=options_),
1377
+ handler=_handler,
1378
+ interceptors=list(interceptors_),
1379
+ )
1380
+ await response.response.aclose()
1381
+ return response.output
1382
+
1383
+ async def list(
1384
+ self,
1385
+ *,
1386
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
1387
+ next_token: Optional[
1388
+ "capo_codeguruprofiler.types.pagination_token.PaginationToken"
1389
+ ] = None,
1390
+ max_results: Optional[
1391
+ "capo_codeguruprofiler.types.max_results.MaxResults"
1392
+ ] = None,
1393
+ include_description: Optional[bool] = None,
1394
+ ) -> "capo_codeguruprofiler.types.list_profiling_groups_response.ListProfilingGroupsResponse":
1395
+ r"""<p> Returns a list of profiling groups. The profiling groups are returned as <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html\"> <code>ProfilingGroupDescription</code> </a> objects. </p>
1396
+
1397
+ Args:
1398
+ next_token: <p>The <code>nextToken</code> value returned from a previous paginated <code>ListProfilingGroups</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. </p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>
1399
+ max_results: <p>The maximum number of profiling groups results returned by <code>ListProfilingGroups</code> in paginated output. When this parameter is used, <code>ListProfilingGroups</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListProfilingGroups</code> request with the returned <code>nextToken</code> value. </p>
1400
+ include_description: <p>A <code>Boolean</code> value indicating whether to include a description. If <code>true</code>, then a list of <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html\"> <code>ProfilingGroupDescription</code> </a> objects that contain detailed information about profiling groups is returned. If <code>false</code>, then a list of profiling group names is returned.</p>
1401
+
1402
+ Raises:
1403
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1404
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1405
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1406
+ """
1407
+
1408
+ async def _handler(
1409
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.list_profiling_groups_request.ListProfilingGroupsRequest]",
1410
+ ) -> AsyncOperationResponse[
1411
+ "capo_codeguruprofiler.types.list_profiling_groups_response.ListProfilingGroupsResponse"
1412
+ ]:
1413
+ import capo_codeguruprofiler._operations.code_guru_profiler.list_profiling_groups
1414
+
1415
+ (
1416
+ output,
1417
+ http_response,
1418
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.list_profiling_groups.async_list_profiling_groups(
1419
+ req.options, req.input
1420
+ )
1421
+ return AsyncOperationResponse(output=output, response=http_response)
1422
+
1423
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1424
+ input_: capo_codeguruprofiler.types.list_profiling_groups_request.ListProfilingGroupsRequest = {}
1425
+ if next_token is not None:
1426
+ input_["next_token"] = next_token
1427
+ if max_results is not None:
1428
+ input_["max_results"] = max_results
1429
+ if include_description is not None:
1430
+ input_["include_description"] = include_description
1431
+
1432
+ response = await aexecute_pipeline(
1433
+ AsyncOperationRequest(input=input_, options=options_),
1434
+ handler=_handler,
1435
+ interceptors=list(interceptors_),
1436
+ )
1437
+ await response.response.aclose()
1438
+ return response.output
1439
+
1440
+ async def add_notification_channels(
1441
+ self,
1442
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1443
+ channels: "capo_codeguruprofiler.types.channels.Channels",
1444
+ *,
1445
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
1446
+ ) -> "capo_codeguruprofiler.types.add_notification_channels_response.AddNotificationChannelsResponse":
1447
+ """<p>Add up to 2 anomaly notifications channels for a profiling group.</p>
1448
+
1449
+ Args:
1450
+ profiling_group_name: <p>The name of the profiling group that we are setting up notifications for.</p>
1451
+ channels: <p>One or 2 channels to report to when anomalies are detected.</p>
1452
+
1453
+ Raises:
1454
+ capo_codeguruprofiler.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
1455
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1456
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
1457
+ capo_codeguruprofiler.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use <a href=\"https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html\">Service Quotas</a> to request a service quota increase. </p>
1458
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1459
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
1460
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1461
+ """
1462
+
1463
+ async def _handler(
1464
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.add_notification_channels_request.AddNotificationChannelsRequest]",
1465
+ ) -> AsyncOperationResponse[
1466
+ "capo_codeguruprofiler.types.add_notification_channels_response.AddNotificationChannelsResponse"
1467
+ ]:
1468
+ import capo_codeguruprofiler._operations.code_guru_profiler.add_notification_channels
1469
+
1470
+ (
1471
+ output,
1472
+ http_response,
1473
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.add_notification_channels.async_add_notification_channels(
1474
+ req.options, req.input
1475
+ )
1476
+ return AsyncOperationResponse(output=output, response=http_response)
1477
+
1478
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1479
+ input_: capo_codeguruprofiler.types.add_notification_channels_request.AddNotificationChannelsRequest = {
1480
+ "profiling_group_name": profiling_group_name,
1481
+ "channels": channels,
1482
+ }
1483
+
1484
+ response = await aexecute_pipeline(
1485
+ AsyncOperationRequest(input=input_, options=options_),
1486
+ handler=_handler,
1487
+ interceptors=list(interceptors_),
1488
+ )
1489
+ await response.response.aclose()
1490
+ return response.output
1491
+
1492
+ async def batch_get_frame_metric_data(
1493
+ self,
1494
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1495
+ *,
1496
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
1497
+ start_time: Optional["capo_codeguruprofiler.types.timestamp.Timestamp"] = None,
1498
+ end_time: Optional["capo_codeguruprofiler.types.timestamp.Timestamp"] = None,
1499
+ period: Optional["capo_codeguruprofiler.types.period.Period"] = None,
1500
+ target_resolution: Optional[
1501
+ "capo_codeguruprofiler.types.aggregation_period.AggregationPeriod"
1502
+ ] = None,
1503
+ frame_metrics: Optional[
1504
+ "capo_codeguruprofiler.types.frame_metrics.FrameMetrics"
1505
+ ] = None,
1506
+ ) -> "capo_codeguruprofiler.types.batch_get_frame_metric_data_response.BatchGetFrameMetricDataResponse":
1507
+ """<p> Returns the time series of values for a requested list of frame metrics from a time period.</p>
1508
+
1509
+ Args:
1510
+ profiling_group_name: <p> The name of the profiling group associated with the the frame metrics used to return the time series values. </p>
1511
+ start_time: <p> The start time of the time period for the frame metrics used to return the time series values. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
1512
+ end_time: <p> The end time of the time period for the returned time series values. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
1513
+ period: <p> The duration of the frame metrics used to return the time series values. Specify using the ISO 8601 format. The maximum period duration is one day (<code>PT24H</code> or <code>P1D</code>). </p>
1514
+ target_resolution: <p>The requested resolution of time steps for the returned time series of values. If the requested target resolution is not available due to data not being retained we provide a best effort result by falling back to the most granular available resolution after the target resolution. There are 3 valid values. </p> <ul> <li> <p> <code>P1D</code> — 1 day </p> </li> <li> <p> <code>PT1H</code> — 1 hour </p> </li> <li> <p> <code>PT5M</code> — 5 minutes </p> </li> </ul>
1515
+ frame_metrics: <p> The details of the metrics that are used to request a time series of values. The metric includes the name of the frame, the aggregation type to calculate the metric value for the frame, and the thread states to use to get the count for the metric value of the frame.</p>
1516
+
1517
+ Raises:
1518
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1519
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
1520
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1521
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
1522
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1523
+ """
1524
+
1525
+ async def _handler(
1526
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.batch_get_frame_metric_data_request.BatchGetFrameMetricDataRequest]",
1527
+ ) -> AsyncOperationResponse[
1528
+ "capo_codeguruprofiler.types.batch_get_frame_metric_data_response.BatchGetFrameMetricDataResponse"
1529
+ ]:
1530
+ import capo_codeguruprofiler._operations.code_guru_profiler.batch_get_frame_metric_data
1531
+
1532
+ (
1533
+ output,
1534
+ http_response,
1535
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.batch_get_frame_metric_data.async_batch_get_frame_metric_data(
1536
+ req.options, req.input
1537
+ )
1538
+ return AsyncOperationResponse(output=output, response=http_response)
1539
+
1540
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1541
+ input_: capo_codeguruprofiler.types.batch_get_frame_metric_data_request.BatchGetFrameMetricDataRequest = {
1542
+ "profiling_group_name": profiling_group_name
1543
+ }
1544
+ if start_time is not None:
1545
+ input_["start_time"] = start_time
1546
+ if end_time is not None:
1547
+ input_["end_time"] = end_time
1548
+ if period is not None:
1549
+ input_["period"] = period
1550
+ if target_resolution is not None:
1551
+ input_["target_resolution"] = target_resolution
1552
+ if frame_metrics is not None:
1553
+ input_["frame_metrics"] = frame_metrics
1554
+
1555
+ response = await aexecute_pipeline(
1556
+ AsyncOperationRequest(input=input_, options=options_),
1557
+ handler=_handler,
1558
+ interceptors=list(interceptors_),
1559
+ )
1560
+ await response.response.aclose()
1561
+ return response.output
1562
+
1563
+ async def configure_agent(
1564
+ self,
1565
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1566
+ *,
1567
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
1568
+ fleet_instance_id: Optional[
1569
+ "capo_codeguruprofiler.types.fleet_instance_id.FleetInstanceId"
1570
+ ] = None,
1571
+ metadata: Optional["capo_codeguruprofiler.types.metadata.Metadata"] = None,
1572
+ ) -> "capo_codeguruprofiler.types.configure_agent_response.ConfigureAgentResponse":
1573
+ """<p> Used by profiler agents to report their current state and to receive remote configuration updates. For example, <code>ConfigureAgent</code> can be used to tell an agent whether to profile or not and for how long to return profiling data. </p>
1574
+
1575
+ Args:
1576
+ profiling_group_name: <p> The name of the profiling group for which the configured agent is collecting profiling data. </p>
1577
+ fleet_instance_id: <p> A universally unique identifier (UUID) for a profiling instance. For example, if the profiling instance is an Amazon EC2 instance, it is the instance ID. If it is an AWS Fargate container, it is the container's task ID. </p>
1578
+ metadata: <p> Metadata captured about the compute platform the agent is running on. It includes information about sampling and reporting. The valid fields are:</p> <ul> <li> <p> <code>COMPUTE_PLATFORM</code> - The compute platform on which the agent is running </p> </li> <li> <p> <code>AGENT_ID</code> - The ID for an agent instance. </p> </li> <li> <p> <code>AWS_REQUEST_ID</code> - The AWS request ID of a Lambda invocation. </p> </li> <li> <p> <code>EXECUTION_ENVIRONMENT</code> - The execution environment a Lambda function is running on. </p> </li> <li> <p> <code>LAMBDA_FUNCTION_ARN</code> - The Amazon Resource Name (ARN) that is used to invoke a Lambda function. </p> </li> <li> <p> <code>LAMBDA_MEMORY_LIMIT_IN_MB</code> - The memory allocated to a Lambda function. </p> </li> <li> <p> <code>LAMBDA_REMAINING_TIME_IN_MILLISECONDS</code> - The time in milliseconds before execution of a Lambda function times out. </p> </li> <li> <p> <code>LAMBDA_TIME_GAP_BETWEEN_INVOKES_IN_MILLISECONDS</code> - The time in milliseconds between two invocations of a Lambda function. </p> </li> <li> <p> <code>LAMBDA_PREVIOUS_EXECUTION_TIME_IN_MILLISECONDS</code> - The time in milliseconds for the previous Lambda invocation. </p> </li> </ul>
1579
+
1580
+ Raises:
1581
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1582
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
1583
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1584
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
1585
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1586
+ """
1587
+
1588
+ async def _handler(
1589
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.configure_agent_request.ConfigureAgentRequest]",
1590
+ ) -> AsyncOperationResponse[
1591
+ "capo_codeguruprofiler.types.configure_agent_response.ConfigureAgentResponse"
1592
+ ]:
1593
+ import capo_codeguruprofiler._operations.code_guru_profiler.configure_agent
1594
+
1595
+ (
1596
+ output,
1597
+ http_response,
1598
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.configure_agent.async_configure_agent(
1599
+ req.options, req.input
1600
+ )
1601
+ return AsyncOperationResponse(output=output, response=http_response)
1602
+
1603
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1604
+ input_: capo_codeguruprofiler.types.configure_agent_request.ConfigureAgentRequest = {
1605
+ "profiling_group_name": profiling_group_name
1606
+ }
1607
+ if fleet_instance_id is not None:
1608
+ input_["fleet_instance_id"] = fleet_instance_id
1609
+ if metadata is not None:
1610
+ input_["metadata"] = metadata
1611
+
1612
+ response = await aexecute_pipeline(
1613
+ AsyncOperationRequest(input=input_, options=options_),
1614
+ handler=_handler,
1615
+ interceptors=list(interceptors_),
1616
+ )
1617
+ await response.response.aclose()
1618
+ return response.output
1619
+
1620
+ async def get_notification_configuration(
1621
+ self,
1622
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1623
+ *,
1624
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
1625
+ ) -> "capo_codeguruprofiler.types.get_notification_configuration_response.GetNotificationConfigurationResponse":
1626
+ """<p>Get the current configuration for anomaly notifications for a profiling group.</p>
1627
+
1628
+ Args:
1629
+ profiling_group_name: <p>The name of the profiling group we want to get the notification configuration for.</p>
1630
+
1631
+ Raises:
1632
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1633
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
1634
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1635
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
1636
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1637
+ """
1638
+
1639
+ async def _handler(
1640
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.get_notification_configuration_request.GetNotificationConfigurationRequest]",
1641
+ ) -> AsyncOperationResponse[
1642
+ "capo_codeguruprofiler.types.get_notification_configuration_response.GetNotificationConfigurationResponse"
1643
+ ]:
1644
+ import capo_codeguruprofiler._operations.code_guru_profiler.get_notification_configuration
1645
+
1646
+ (
1647
+ output,
1648
+ http_response,
1649
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.get_notification_configuration.async_get_notification_configuration(
1650
+ req.options, req.input
1651
+ )
1652
+ return AsyncOperationResponse(output=output, response=http_response)
1653
+
1654
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1655
+ input_: capo_codeguruprofiler.types.get_notification_configuration_request.GetNotificationConfigurationRequest = {
1656
+ "profiling_group_name": profiling_group_name
1657
+ }
1658
+
1659
+ response = await aexecute_pipeline(
1660
+ AsyncOperationRequest(input=input_, options=options_),
1661
+ handler=_handler,
1662
+ interceptors=list(interceptors_),
1663
+ )
1664
+ await response.response.aclose()
1665
+ return response.output
1666
+
1667
+ async def get_policy(
1668
+ self,
1669
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1670
+ *,
1671
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
1672
+ ) -> "capo_codeguruprofiler.types.get_policy_response.GetPolicyResponse":
1673
+ """<p> Returns the JSON-formatted resource-based policy on a profiling group. </p>
1674
+
1675
+ Args:
1676
+ profiling_group_name: <p>The name of the profiling group.</p>
1677
+
1678
+ Raises:
1679
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1680
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
1681
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1682
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1683
+ """
1684
+
1685
+ async def _handler(
1686
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.get_policy_request.GetPolicyRequest]",
1687
+ ) -> AsyncOperationResponse[
1688
+ "capo_codeguruprofiler.types.get_policy_response.GetPolicyResponse"
1689
+ ]:
1690
+ import capo_codeguruprofiler._operations.code_guru_profiler.get_policy
1691
+
1692
+ (
1693
+ output,
1694
+ http_response,
1695
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.get_policy.async_get_policy(
1696
+ req.options, req.input
1697
+ )
1698
+ return AsyncOperationResponse(output=output, response=http_response)
1699
+
1700
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1701
+ input_: capo_codeguruprofiler.types.get_policy_request.GetPolicyRequest = {
1702
+ "profiling_group_name": profiling_group_name
1703
+ }
1704
+
1705
+ response = await aexecute_pipeline(
1706
+ AsyncOperationRequest(input=input_, options=options_),
1707
+ handler=_handler,
1708
+ interceptors=list(interceptors_),
1709
+ )
1710
+ await response.response.aclose()
1711
+ return response.output
1712
+
1713
+ async def get_profile(
1714
+ self,
1715
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1716
+ *,
1717
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
1718
+ start_time: Optional["capo_codeguruprofiler.types.timestamp.Timestamp"] = None,
1719
+ period: Optional["capo_codeguruprofiler.types.period.Period"] = None,
1720
+ end_time: Optional["capo_codeguruprofiler.types.timestamp.Timestamp"] = None,
1721
+ max_depth: Optional["capo_codeguruprofiler.types.max_depth.MaxDepth"] = None,
1722
+ accept: Optional[str] = None,
1723
+ ) -> "capo_codeguruprofiler.types.get_profile_response.GetProfileResponse":
1724
+ r"""<p> Gets the aggregated profile of a profiling group for a specified time range. Amazon CodeGuru Profiler collects posted agent profiles for a profiling group into aggregated profiles. </p> <note> <p> Because aggregated profiles expire over time <code>GetProfile</code> is not idempotent. </p> </note> <p> Specify the time range for the requested aggregated profile using 1 or 2 of the following parameters: <code>startTime</code>, <code>endTime</code>, <code>period</code>. The maximum time range allowed is 7 days. If you specify all 3 parameters, an exception is thrown. If you specify only <code>period</code>, the latest aggregated profile is returned. </p> <p> Aggregated profiles are available with aggregation periods of 5 minutes, 1 hour, and 1 day, aligned to UTC. The aggregation period of an aggregated profile determines how long it is retained. For more information, see <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_AggregatedProfileTime.html\"> <code>AggregatedProfileTime</code> </a>. The aggregated profile's aggregation period determines how long it is retained by CodeGuru Profiler. </p> <ul> <li> <p> If the aggregation period is 5 minutes, the aggregated profile is retained for 15 days. </p> </li> <li> <p> If the aggregation period is 1 hour, the aggregated profile is retained for 60 days. </p> </li> <li> <p> If the aggregation period is 1 day, the aggregated profile is retained for 3 years. </p> </li> </ul> <p>There are two use cases for calling <code>GetProfile</code>.</p> <ol> <li> <p> If you want to return an aggregated profile that already exists, use <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ListProfileTimes.html\"> <code>ListProfileTimes</code> </a> to view the time ranges of existing aggregated profiles. Use them in a <code>GetProfile</code> request to return a specific, existing aggregated profile. </p> </li> <li> <p> If you want to return an aggregated profile for a time range that doesn't align with an existing aggregated profile, then CodeGuru Profiler makes a best effort to combine existing aggregated profiles from the requested time range and return them as one aggregated profile. </p> <p> If aggregated profiles do not exist for the full time range requested, then aggregated profiles for a smaller time range are returned. For example, if the requested time range is from 00:00 to 00:20, and the existing aggregated profiles are from 00:15 and 00:25, then the aggregated profiles from 00:15 to 00:20 are returned. </p> </li> </ol>
1725
+
1726
+ Args:
1727
+ profiling_group_name: <p>The name of the profiling group to get.</p>
1728
+ start_time: <p>The start time of the profile to get. Specify using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p> <p> If you specify <code>startTime</code>, then you must also specify <code>period</code> or <code>endTime</code>, but not both. </p>
1729
+ period: <p> Used with <code>startTime</code> or <code>endTime</code> to specify the time range for the returned aggregated profile. Specify using the ISO 8601 format. For example, <code>P1DT1H1M1S</code>. </p> <p> To get the latest aggregated profile, specify only <code>period</code>. </p>
1730
+ end_time: <p> The end time of the requested profile. Specify using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p> <p> If you specify <code>endTime</code>, then you must also specify <code>period</code> or <code>startTime</code>, but not both. </p>
1731
+ max_depth: <p> The maximum depth of the stacks in the code that is represented in the aggregated profile. For example, if CodeGuru Profiler finds a method <code>A</code>, which calls method <code>B</code>, which calls method <code>C</code>, which calls method <code>D</code>, then the depth is 4. If the <code>maxDepth</code> is set to 2, then the aggregated profile contains representations of methods <code>A</code> and <code>B</code>. </p>
1732
+ accept: <p> The format of the returned profiling data. The format maps to the <code>Accept</code> and <code>Content-Type</code> headers of the HTTP request. You can specify one of the following: or the default . </p> <ul> <li> <p> <code>application/json</code> — standard JSON format </p> </li> <li> <p> <code>application/x-amzn-ion</code> — the Amazon Ion data format. For more information, see <a href=\"http://amzn.github.io/ion-docs/\">Amazon Ion</a>. </p> </li> </ul>
1733
+
1734
+ Raises:
1735
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1736
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
1737
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1738
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
1739
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1740
+ """
1741
+
1742
+ async def _handler(
1743
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.get_profile_request.GetProfileRequest]",
1744
+ ) -> AsyncOperationResponse[
1745
+ "capo_codeguruprofiler.types.get_profile_response.GetProfileResponse"
1746
+ ]:
1747
+ import capo_codeguruprofiler._operations.code_guru_profiler.get_profile
1748
+
1749
+ (
1750
+ output,
1751
+ http_response,
1752
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.get_profile.async_get_profile(
1753
+ req.options, req.input
1754
+ )
1755
+ return AsyncOperationResponse(output=output, response=http_response)
1756
+
1757
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1758
+ input_: capo_codeguruprofiler.types.get_profile_request.GetProfileRequest = {
1759
+ "profiling_group_name": profiling_group_name
1760
+ }
1761
+ if start_time is not None:
1762
+ input_["start_time"] = start_time
1763
+ if period is not None:
1764
+ input_["period"] = period
1765
+ if end_time is not None:
1766
+ input_["end_time"] = end_time
1767
+ if max_depth is not None:
1768
+ input_["max_depth"] = max_depth
1769
+ if accept is not None:
1770
+ input_["accept"] = accept
1771
+
1772
+ response = await aexecute_pipeline(
1773
+ AsyncOperationRequest(input=input_, options=options_),
1774
+ handler=_handler,
1775
+ interceptors=list(interceptors_),
1776
+ )
1777
+ await response.response.aclose()
1778
+ return response.output
1779
+
1780
+ async def get_recommendations(
1781
+ self,
1782
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1783
+ start_time: "capo_codeguruprofiler.types.timestamp.Timestamp",
1784
+ end_time: "capo_codeguruprofiler.types.timestamp.Timestamp",
1785
+ *,
1786
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
1787
+ locale: Optional["capo_codeguruprofiler.types.locale.Locale"] = None,
1788
+ ) -> "capo_codeguruprofiler.types.get_recommendations_response.GetRecommendationsResponse":
1789
+ r"""<p> Returns a list of <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_Recommendation.html\"> <code>Recommendation</code> </a> objects that contain recommendations for a profiling group for a given time period. A list of <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_Anomaly.html\"> <code>Anomaly</code> </a> objects that contains details about anomalies detected in the profiling group for the same time period is also returned. </p>
1790
+
1791
+ Args:
1792
+ profiling_group_name: <p> The name of the profiling group to get analysis data about. </p>
1793
+ start_time: <p> The end time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
1794
+ end_time: <p> The start time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
1795
+ locale: <p> The language used to provide analysis. Specify using a string that is one of the following <code>BCP 47</code> language codes. </p> <ul> <li> <p> <code>de-DE</code> - German, Germany </p> </li> <li> <p> <code>en-GB</code> - English, United Kingdom </p> </li> <li> <p> <code>en-US</code> - English, United States </p> </li> <li> <p> <code>es-ES</code> - Spanish, Spain </p> </li> <li> <p> <code>fr-FR</code> - French, France </p> </li> <li> <p> <code>it-IT</code> - Italian, Italy </p> </li> <li> <p> <code>ja-JP</code> - Japanese, Japan </p> </li> <li> <p> <code>ko-KR</code> - Korean, Republic of Korea </p> </li> <li> <p> <code>pt-BR</code> - Portugese, Brazil </p> </li> <li> <p> <code>zh-CN</code> - Chinese, China </p> </li> <li> <p> <code>zh-TW</code> - Chinese, Taiwan </p> </li> </ul>
1796
+
1797
+ Raises:
1798
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1799
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
1800
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1801
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
1802
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1803
+ """
1804
+
1805
+ async def _handler(
1806
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.get_recommendations_request.GetRecommendationsRequest]",
1807
+ ) -> AsyncOperationResponse[
1808
+ "capo_codeguruprofiler.types.get_recommendations_response.GetRecommendationsResponse"
1809
+ ]:
1810
+ import capo_codeguruprofiler._operations.code_guru_profiler.get_recommendations
1811
+
1812
+ (
1813
+ output,
1814
+ http_response,
1815
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.get_recommendations.async_get_recommendations(
1816
+ req.options, req.input
1817
+ )
1818
+ return AsyncOperationResponse(output=output, response=http_response)
1819
+
1820
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1821
+ input_: capo_codeguruprofiler.types.get_recommendations_request.GetRecommendationsRequest = {
1822
+ "profiling_group_name": profiling_group_name,
1823
+ "start_time": start_time,
1824
+ "end_time": end_time,
1825
+ }
1826
+ if locale is not None:
1827
+ input_["locale"] = locale
1828
+
1829
+ response = await aexecute_pipeline(
1830
+ AsyncOperationRequest(input=input_, options=options_),
1831
+ handler=_handler,
1832
+ interceptors=list(interceptors_),
1833
+ )
1834
+ await response.response.aclose()
1835
+ return response.output
1836
+
1837
+ async def list_findings_reports(
1838
+ self,
1839
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1840
+ start_time: "capo_codeguruprofiler.types.timestamp.Timestamp",
1841
+ end_time: "capo_codeguruprofiler.types.timestamp.Timestamp",
1842
+ *,
1843
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
1844
+ next_token: Optional[
1845
+ "capo_codeguruprofiler.types.pagination_token.PaginationToken"
1846
+ ] = None,
1847
+ max_results: Optional[
1848
+ "capo_codeguruprofiler.types.max_results.MaxResults"
1849
+ ] = None,
1850
+ daily_reports_only: Optional[bool] = None,
1851
+ ) -> "capo_codeguruprofiler.types.list_findings_reports_response.ListFindingsReportsResponse":
1852
+ """<p>List the available reports for a given profiling group and time range.</p>
1853
+
1854
+ Args:
1855
+ profiling_group_name: <p>The name of the profiling group from which to search for analysis data.</p>
1856
+ start_time: <p> The start time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
1857
+ end_time: <p> The end time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
1858
+ next_token: <p>The <code>nextToken</code> value returned from a previous paginated <code>ListFindingsReportsRequest</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. </p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>
1859
+ max_results: <p>The maximum number of report results returned by <code>ListFindingsReports</code> in paginated output. When this parameter is used, <code>ListFindingsReports</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListFindingsReports</code> request with the returned <code>nextToken</code> value.</p>
1860
+ daily_reports_only: <p>A <code>Boolean</code> value indicating whether to only return reports from daily profiles. If set to <code>True</code>, only analysis data from daily profiles is returned. If set to <code>False</code>, analysis data is returned from smaller time windows (for example, one hour).</p>
1861
+
1862
+ Raises:
1863
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1864
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
1865
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1866
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
1867
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1868
+ """
1869
+
1870
+ async def _handler(
1871
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.list_findings_reports_request.ListFindingsReportsRequest]",
1872
+ ) -> AsyncOperationResponse[
1873
+ "capo_codeguruprofiler.types.list_findings_reports_response.ListFindingsReportsResponse"
1874
+ ]:
1875
+ import capo_codeguruprofiler._operations.code_guru_profiler.list_findings_reports
1876
+
1877
+ (
1878
+ output,
1879
+ http_response,
1880
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.list_findings_reports.async_list_findings_reports(
1881
+ req.options, req.input
1882
+ )
1883
+ return AsyncOperationResponse(output=output, response=http_response)
1884
+
1885
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1886
+ input_: capo_codeguruprofiler.types.list_findings_reports_request.ListFindingsReportsRequest = {
1887
+ "profiling_group_name": profiling_group_name,
1888
+ "start_time": start_time,
1889
+ "end_time": end_time,
1890
+ }
1891
+ if next_token is not None:
1892
+ input_["next_token"] = next_token
1893
+ if max_results is not None:
1894
+ input_["max_results"] = max_results
1895
+ if daily_reports_only is not None:
1896
+ input_["daily_reports_only"] = daily_reports_only
1897
+
1898
+ response = await aexecute_pipeline(
1899
+ AsyncOperationRequest(input=input_, options=options_),
1900
+ handler=_handler,
1901
+ interceptors=list(interceptors_),
1902
+ )
1903
+ await response.response.aclose()
1904
+ return response.output
1905
+
1906
+ async def list_profile_times(
1907
+ self,
1908
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1909
+ start_time: "capo_codeguruprofiler.types.timestamp.Timestamp",
1910
+ end_time: "capo_codeguruprofiler.types.timestamp.Timestamp",
1911
+ period: "capo_codeguruprofiler.types.aggregation_period.AggregationPeriod",
1912
+ *,
1913
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
1914
+ order_by: Optional["capo_codeguruprofiler.types.order_by.OrderBy"] = None,
1915
+ max_results: Optional[
1916
+ "capo_codeguruprofiler.types.max_results.MaxResults"
1917
+ ] = None,
1918
+ next_token: Optional[
1919
+ "capo_codeguruprofiler.types.pagination_token.PaginationToken"
1920
+ ] = None,
1921
+ ) -> "capo_codeguruprofiler.types.list_profile_times_response.ListProfileTimesResponse":
1922
+ """<p>Lists the start times of the available aggregated profiles of a profiling group for an aggregation period within the specified time range.</p>
1923
+
1924
+ Args:
1925
+ profiling_group_name: <p>The name of the profiling group.</p>
1926
+ start_time: <p>The start time of the time range from which to list the profiles.</p>
1927
+ end_time: <p>The end time of the time range from which to list the profiles.</p>
1928
+ period: <p> The aggregation period. This specifies the period during which an aggregation profile collects posted agent profiles for a profiling group. There are 3 valid values. </p> <ul> <li> <p> <code>P1D</code> — 1 day </p> </li> <li> <p> <code>PT1H</code> — 1 hour </p> </li> <li> <p> <code>PT5M</code> — 5 minutes </p> </li> </ul>
1929
+ order_by: <p>The order (ascending or descending by start time of the profile) to use when listing profiles. Defaults to <code>TIMESTAMP_DESCENDING</code>. </p>
1930
+ max_results: <p>The maximum number of profile time results returned by <code>ListProfileTimes</code> in paginated output. When this parameter is used, <code>ListProfileTimes</code> only returns <code>maxResults</code> results in a single page with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListProfileTimes</code> request with the returned <code>nextToken</code> value. </p>
1931
+ next_token: <p>The <code>nextToken</code> value returned from a previous paginated <code>ListProfileTimes</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. </p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>
1932
+
1933
+ Raises:
1934
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1935
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
1936
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
1937
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
1938
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
1939
+ """
1940
+
1941
+ async def _handler(
1942
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.list_profile_times_request.ListProfileTimesRequest]",
1943
+ ) -> AsyncOperationResponse[
1944
+ "capo_codeguruprofiler.types.list_profile_times_response.ListProfileTimesResponse"
1945
+ ]:
1946
+ import capo_codeguruprofiler._operations.code_guru_profiler.list_profile_times
1947
+
1948
+ (
1949
+ output,
1950
+ http_response,
1951
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.list_profile_times.async_list_profile_times(
1952
+ req.options, req.input
1953
+ )
1954
+ return AsyncOperationResponse(output=output, response=http_response)
1955
+
1956
+ interceptors_, options_ = self._service.operation_options(config_overrides)
1957
+ input_: capo_codeguruprofiler.types.list_profile_times_request.ListProfileTimesRequest = {
1958
+ "profiling_group_name": profiling_group_name,
1959
+ "start_time": start_time,
1960
+ "end_time": end_time,
1961
+ "period": period,
1962
+ }
1963
+ if order_by is not None:
1964
+ input_["order_by"] = order_by
1965
+ if max_results is not None:
1966
+ input_["max_results"] = max_results
1967
+ if next_token is not None:
1968
+ input_["next_token"] = next_token
1969
+
1970
+ response = await aexecute_pipeline(
1971
+ AsyncOperationRequest(input=input_, options=options_),
1972
+ handler=_handler,
1973
+ interceptors=list(interceptors_),
1974
+ )
1975
+ await response.response.aclose()
1976
+ return response.output
1977
+
1978
+ async def post_agent_profile(
1979
+ self,
1980
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
1981
+ agent_profile: "capo_codeguruprofiler.types.agent_profile.AgentProfile",
1982
+ content_type: str,
1983
+ *,
1984
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
1985
+ profile_token: Optional[
1986
+ "capo_codeguruprofiler.types.client_token.ClientToken"
1987
+ ] = None,
1988
+ ) -> "capo_codeguruprofiler.types.post_agent_profile_response.PostAgentProfileResponse":
1989
+ r"""<p> Submits profiling data to an aggregated profile of a profiling group. To get an aggregated profile that is created with this profiling data, use <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_GetProfile.html\"> <code>GetProfile</code> </a>. </p>
1990
+
1991
+ Args:
1992
+ profiling_group_name: <p> The name of the profiling group with the aggregated profile that receives the submitted profiling data. </p>
1993
+ agent_profile: <p> The submitted profiling data. </p>
1994
+ profile_token: <p> Amazon CodeGuru Profiler uses this universally unique identifier (UUID) to prevent the accidental submission of duplicate profiling data if there are failures and retries. </p>
1995
+ content_type: <p> The format of the submitted profiling data. The format maps to the <code>Accept</code> and <code>Content-Type</code> headers of the HTTP request. You can specify one of the following: or the default . </p> <ul> <li> <p> <code>application/json</code> — standard JSON format </p> </li> <li> <p> <code>application/x-amzn-ion</code> — the Amazon Ion data format. For more information, see <a href=\"http://amzn.github.io/ion-docs/\">Amazon Ion</a>. </p> </li> </ul>
1996
+
1997
+ Raises:
1998
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
1999
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
2000
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
2001
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
2002
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
2003
+ """
2004
+
2005
+ async def _handler(
2006
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.post_agent_profile_request.PostAgentProfileRequest]",
2007
+ ) -> AsyncOperationResponse[
2008
+ "capo_codeguruprofiler.types.post_agent_profile_response.PostAgentProfileResponse"
2009
+ ]:
2010
+ import capo_codeguruprofiler._operations.code_guru_profiler.post_agent_profile
2011
+
2012
+ (
2013
+ output,
2014
+ http_response,
2015
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.post_agent_profile.async_post_agent_profile(
2016
+ req.options, req.input
2017
+ )
2018
+ return AsyncOperationResponse(output=output, response=http_response)
2019
+
2020
+ interceptors_, options_ = self._service.operation_options(config_overrides)
2021
+ input_: capo_codeguruprofiler.types.post_agent_profile_request.PostAgentProfileRequest = {
2022
+ "profiling_group_name": profiling_group_name,
2023
+ "agent_profile": agent_profile,
2024
+ "content_type": content_type,
2025
+ }
2026
+ if profile_token is None:
2027
+ profile_token = str(uuid.uuid4())
2028
+ input_["profile_token"] = profile_token
2029
+
2030
+ response = await aexecute_pipeline(
2031
+ AsyncOperationRequest(input=input_, options=options_),
2032
+ handler=_handler,
2033
+ interceptors=list(interceptors_),
2034
+ )
2035
+ await response.response.aclose()
2036
+ return response.output
2037
+
2038
+ async def put_permission(
2039
+ self,
2040
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
2041
+ action_group: "capo_codeguruprofiler.types.action_group.ActionGroup",
2042
+ principals: "capo_codeguruprofiler.types.principals.Principals",
2043
+ *,
2044
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
2045
+ revision_id: Optional[
2046
+ "capo_codeguruprofiler.types.revision_id.RevisionId"
2047
+ ] = None,
2048
+ ) -> "capo_codeguruprofiler.types.put_permission_response.PutPermissionResponse":
2049
+ r"""<p> Adds permissions to a profiling group's resource-based policy that are provided using an action group. If a profiling group doesn't have a resource-based policy, one is created for it using the permissions in the action group and the roles and users in the <code>principals</code> parameter. </p> <p> The one supported action group that can be added is <code>agentPermission</code> which grants <code>ConfigureAgent</code> and <code>PostAgent</code> permissions. For more information, see <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-ug/resource-based-policies.html\">Resource-based policies in CodeGuru Profiler</a> in the <i>Amazon CodeGuru Profiler User Guide</i>, <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ConfigureAgent.html\"> <code>ConfigureAgent</code> </a>, and <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_PostAgentProfile.html\"> <code>PostAgentProfile</code> </a>. </p> <p> The first time you call <code>PutPermission</code> on a profiling group, do not specify a <code>revisionId</code> because it doesn't have a resource-based policy. Subsequent calls must provide a <code>revisionId</code> to specify which revision of the resource-based policy to add the permissions to. </p> <p> The response contains the profiling group's JSON-formatted resource policy. </p>
2050
+
2051
+ Args:
2052
+ profiling_group_name: <p>The name of the profiling group to grant access to.</p>
2053
+ action_group: <p> Specifies an action group that contains permissions to add to a profiling group resource. One action group is supported, <code>agentPermissions</code>, which grants permission to perform actions required by the profiling agent, <code>ConfigureAgent</code> and <code>PostAgentProfile</code> permissions. </p>
2054
+ principals: <p> A list ARNs for the roles and users you want to grant access to the profiling group. Wildcards are not are supported in the ARNs. </p>
2055
+ revision_id: <p> A universally unique identifier (UUID) for the revision of the policy you are adding to the profiling group. Do not specify this when you add permissions to a profiling group for the first time. If a policy already exists on the profiling group, you must specify the <code>revisionId</code>. </p>
2056
+
2057
+ Raises:
2058
+ capo_codeguruprofiler.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
2059
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
2060
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
2061
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
2062
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
2063
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
2064
+ """
2065
+
2066
+ async def _handler(
2067
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.put_permission_request.PutPermissionRequest]",
2068
+ ) -> AsyncOperationResponse[
2069
+ "capo_codeguruprofiler.types.put_permission_response.PutPermissionResponse"
2070
+ ]:
2071
+ import capo_codeguruprofiler._operations.code_guru_profiler.put_permission
2072
+
2073
+ (
2074
+ output,
2075
+ http_response,
2076
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.put_permission.async_put_permission(
2077
+ req.options, req.input
2078
+ )
2079
+ return AsyncOperationResponse(output=output, response=http_response)
2080
+
2081
+ interceptors_, options_ = self._service.operation_options(config_overrides)
2082
+ input_: capo_codeguruprofiler.types.put_permission_request.PutPermissionRequest = {
2083
+ "profiling_group_name": profiling_group_name,
2084
+ "action_group": action_group,
2085
+ "principals": principals,
2086
+ }
2087
+ if revision_id is not None:
2088
+ input_["revision_id"] = revision_id
2089
+
2090
+ response = await aexecute_pipeline(
2091
+ AsyncOperationRequest(input=input_, options=options_),
2092
+ handler=_handler,
2093
+ interceptors=list(interceptors_),
2094
+ )
2095
+ await response.response.aclose()
2096
+ return response.output
2097
+
2098
+ async def remove_notification_channel(
2099
+ self,
2100
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
2101
+ channel_id: "capo_codeguruprofiler.types.channel_id.ChannelId",
2102
+ *,
2103
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
2104
+ ) -> "capo_codeguruprofiler.types.remove_notification_channel_response.RemoveNotificationChannelResponse":
2105
+ """<p>Remove one anomaly notifications channel for a profiling group.</p>
2106
+
2107
+ Args:
2108
+ profiling_group_name: <p>The name of the profiling group we want to change notification configuration for.</p>
2109
+ channel_id: <p>The id of the channel that we want to stop receiving notifications.</p>
2110
+
2111
+ Raises:
2112
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
2113
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
2114
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
2115
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
2116
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
2117
+ """
2118
+
2119
+ async def _handler(
2120
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.remove_notification_channel_request.RemoveNotificationChannelRequest]",
2121
+ ) -> AsyncOperationResponse[
2122
+ "capo_codeguruprofiler.types.remove_notification_channel_response.RemoveNotificationChannelResponse"
2123
+ ]:
2124
+ import capo_codeguruprofiler._operations.code_guru_profiler.remove_notification_channel
2125
+
2126
+ (
2127
+ output,
2128
+ http_response,
2129
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.remove_notification_channel.async_remove_notification_channel(
2130
+ req.options, req.input
2131
+ )
2132
+ return AsyncOperationResponse(output=output, response=http_response)
2133
+
2134
+ interceptors_, options_ = self._service.operation_options(config_overrides)
2135
+ input_: capo_codeguruprofiler.types.remove_notification_channel_request.RemoveNotificationChannelRequest = {
2136
+ "profiling_group_name": profiling_group_name,
2137
+ "channel_id": channel_id,
2138
+ }
2139
+
2140
+ response = await aexecute_pipeline(
2141
+ AsyncOperationRequest(input=input_, options=options_),
2142
+ handler=_handler,
2143
+ interceptors=list(interceptors_),
2144
+ )
2145
+ await response.response.aclose()
2146
+ return response.output
2147
+
2148
+ async def remove_permission(
2149
+ self,
2150
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
2151
+ action_group: "capo_codeguruprofiler.types.action_group.ActionGroup",
2152
+ revision_id: "capo_codeguruprofiler.types.revision_id.RevisionId",
2153
+ *,
2154
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
2155
+ ) -> "capo_codeguruprofiler.types.remove_permission_response.RemovePermissionResponse":
2156
+ r"""<p> Removes permissions from a profiling group's resource-based policy that are provided using an action group. The one supported action group that can be removed is <code>agentPermission</code> which grants <code>ConfigureAgent</code> and <code>PostAgent</code> permissions. For more information, see <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-ug/resource-based-policies.html\">Resource-based policies in CodeGuru Profiler</a> in the <i>Amazon CodeGuru Profiler User Guide</i>, <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ConfigureAgent.html\"> <code>ConfigureAgent</code> </a>, and <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_PostAgentProfile.html\"> <code>PostAgentProfile</code> </a>. </p>
2157
+
2158
+ Args:
2159
+ profiling_group_name: <p>The name of the profiling group.</p>
2160
+ action_group: <p> Specifies an action group that contains the permissions to remove from a profiling group's resource-based policy. One action group is supported, <code>agentPermissions</code>, which grants <code>ConfigureAgent</code> and <code>PostAgentProfile</code> permissions. </p>
2161
+ revision_id: <p> A universally unique identifier (UUID) for the revision of the resource-based policy from which you want to remove permissions. </p>
2162
+
2163
+ Raises:
2164
+ capo_codeguruprofiler.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
2165
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
2166
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
2167
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
2168
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
2169
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
2170
+ """
2171
+
2172
+ async def _handler(
2173
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.remove_permission_request.RemovePermissionRequest]",
2174
+ ) -> AsyncOperationResponse[
2175
+ "capo_codeguruprofiler.types.remove_permission_response.RemovePermissionResponse"
2176
+ ]:
2177
+ import capo_codeguruprofiler._operations.code_guru_profiler.remove_permission
2178
+
2179
+ (
2180
+ output,
2181
+ http_response,
2182
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.remove_permission.async_remove_permission(
2183
+ req.options, req.input
2184
+ )
2185
+ return AsyncOperationResponse(output=output, response=http_response)
2186
+
2187
+ interceptors_, options_ = self._service.operation_options(config_overrides)
2188
+ input_: capo_codeguruprofiler.types.remove_permission_request.RemovePermissionRequest = {
2189
+ "profiling_group_name": profiling_group_name,
2190
+ "action_group": action_group,
2191
+ "revision_id": revision_id,
2192
+ }
2193
+
2194
+ response = await aexecute_pipeline(
2195
+ AsyncOperationRequest(input=input_, options=options_),
2196
+ handler=_handler,
2197
+ interceptors=list(interceptors_),
2198
+ )
2199
+ await response.response.aclose()
2200
+ return response.output
2201
+
2202
+ async def submit_feedback(
2203
+ self,
2204
+ profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
2205
+ anomaly_instance_id: "capo_codeguruprofiler.types.anomaly_instance_id.AnomalyInstanceId",
2206
+ type: "capo_codeguruprofiler.types.feedback_type.FeedbackType",
2207
+ *,
2208
+ config_overrides: Optional[AsyncCodeGuruProfilerClientConfig] = None,
2209
+ comment: Optional[str] = None,
2210
+ ) -> "capo_codeguruprofiler.types.submit_feedback_response.SubmitFeedbackResponse":
2211
+ r"""<p>Sends feedback to CodeGuru Profiler about whether the anomaly detected by the analysis is useful or not.</p>
2212
+
2213
+ Args:
2214
+ profiling_group_name: <p>The name of the profiling group that is associated with the analysis data.</p>
2215
+ anomaly_instance_id: <p>The universally unique identifier (UUID) of the <a href=\"https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_AnomalyInstance.html\"> <code>AnomalyInstance</code> </a> object that is included in the analysis data.</p>
2216
+ type: <p> The feedback tpye. Thee are two valid values, <code>Positive</code> and <code>Negative</code>. </p>
2217
+ comment: <p>Optional feedback about this anomaly.</p>
2218
+
2219
+ Raises:
2220
+ capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
2221
+ capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
2222
+ capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
2223
+ capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
2224
+ capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
2225
+ """
2226
+
2227
+ async def _handler(
2228
+ req: "AsyncOperationRequest[capo_codeguruprofiler.types.submit_feedback_request.SubmitFeedbackRequest]",
2229
+ ) -> AsyncOperationResponse[
2230
+ "capo_codeguruprofiler.types.submit_feedback_response.SubmitFeedbackResponse"
2231
+ ]:
2232
+ import capo_codeguruprofiler._operations.code_guru_profiler.submit_feedback
2233
+
2234
+ (
2235
+ output,
2236
+ http_response,
2237
+ ) = await capo_codeguruprofiler._operations.code_guru_profiler.submit_feedback.async_submit_feedback(
2238
+ req.options, req.input
2239
+ )
2240
+ return AsyncOperationResponse(output=output, response=http_response)
2241
+
2242
+ interceptors_, options_ = self._service.operation_options(config_overrides)
2243
+ input_: capo_codeguruprofiler.types.submit_feedback_request.SubmitFeedbackRequest = {
2244
+ "profiling_group_name": profiling_group_name,
2245
+ "anomaly_instance_id": anomaly_instance_id,
2246
+ "type": type,
2247
+ }
2248
+ if comment is not None:
2249
+ input_["comment"] = comment
2250
+
2251
+ response = await aexecute_pipeline(
2252
+ AsyncOperationRequest(input=input_, options=options_),
2253
+ handler=_handler,
2254
+ interceptors=list(interceptors_),
2255
+ )
2256
+ await response.response.aclose()
2257
+ return response.output