|
15 | 15 | use AsyncAws\CloudWatchLogs\Exception\UnrecognizedClientException; |
16 | 16 | use AsyncAws\CloudWatchLogs\Input\CreateLogGroupRequest; |
17 | 17 | use AsyncAws\CloudWatchLogs\Input\CreateLogStreamRequest; |
| 18 | +use AsyncAws\CloudWatchLogs\Input\DescribeLogGroupsRequest; |
18 | 19 | use AsyncAws\CloudWatchLogs\Input\DescribeLogStreamsRequest; |
19 | 20 | use AsyncAws\CloudWatchLogs\Input\FilterLogEventsRequest; |
20 | 21 | use AsyncAws\CloudWatchLogs\Input\PutLogEventsRequest; |
| 22 | +use AsyncAws\CloudWatchLogs\Result\DescribeLogGroupsResponse; |
21 | 23 | use AsyncAws\CloudWatchLogs\Result\DescribeLogStreamsResponse; |
22 | 24 | use AsyncAws\CloudWatchLogs\Result\FilterLogEventsResponse; |
23 | 25 | use AsyncAws\CloudWatchLogs\Result\PutLogEventsResponse; |
@@ -130,6 +132,50 @@ public function createLogStream($input): Result |
130 | 132 | return new Result($response); |
131 | 133 | } |
132 | 134 |
|
| 135 | + /** |
| 136 | + * Returns information about log groups. You can return all your log groups or filter the results by prefix. The results |
| 137 | + * are ASCII-sorted by log group name. |
| 138 | + * |
| 139 | + * CloudWatch Logs doesn't support IAM policies that control access to the `DescribeLogGroups` action by using the |
| 140 | + * `aws:ResourceTag/*key-name*` condition key. Other CloudWatch Logs actions do support the use of the |
| 141 | + * `aws:ResourceTag/*key-name*` condition key to control access. For more information about using tags to control |
| 142 | + * access, see Controlling access to Amazon Web Services resources using tags [^1]. |
| 143 | + * |
| 144 | + * If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view |
| 145 | + * data from the linked source accounts. For more information, see CloudWatch cross-account observability [^2]. |
| 146 | + * |
| 147 | + * [^1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html |
| 148 | + * [^2]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html |
| 149 | + * |
| 150 | + * @see https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeLogGroups.html |
| 151 | + * @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-logs-2014-03-28.html#describeloggroups |
| 152 | + * |
| 153 | + * @param array{ |
| 154 | + * accountIdentifiers?: null|string[], |
| 155 | + * logGroupNamePrefix?: null|string, |
| 156 | + * logGroupNamePattern?: null|string, |
| 157 | + * nextToken?: null|string, |
| 158 | + * limit?: null|int, |
| 159 | + * includeLinkedAccounts?: null|bool, |
| 160 | + * logGroupClass?: null|LogGroupClass::*, |
| 161 | + * logGroupIdentifiers?: null|string[], |
| 162 | + * '@region'?: string|null, |
| 163 | + * }|DescribeLogGroupsRequest $input |
| 164 | + * |
| 165 | + * @throws InvalidParameterException |
| 166 | + * @throws ServiceUnavailableException |
| 167 | + */ |
| 168 | + public function describeLogGroups($input = []): DescribeLogGroupsResponse |
| 169 | + { |
| 170 | + $input = DescribeLogGroupsRequest::create($input); |
| 171 | + $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'DescribeLogGroups', 'region' => $input->getRegion(), 'exceptionMapping' => [ |
| 172 | + 'InvalidParameterException' => InvalidParameterException::class, |
| 173 | + 'ServiceUnavailableException' => ServiceUnavailableException::class, |
| 174 | + ]])); |
| 175 | + |
| 176 | + return new DescribeLogGroupsResponse($response, $this, $input); |
| 177 | + } |
| 178 | + |
133 | 179 | /** |
134 | 180 | * Lists the log streams for the specified log group. You can list all the log streams or filter the results by prefix. |
135 | 181 | * You can also control how the results are ordered. |
|
0 commit comments