-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds JSON RPC protocol support for operations such as StartLiveTail from CloudwatchLogs. This change also modifies the DecodingEventStreamIterator so it can handle responses where its body is streamable.
- Loading branch information
1 parent
2fd8cae
commit 1058abc
Showing
4 changed files
with
164 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace Aws\Test\CloudWatchLogs; | ||
|
||
use Aws\CloudWatchLogs\CloudWatchLogsClient; | ||
use Aws\CommandInterface; | ||
use GuzzleHttp\Psr7\Response; | ||
use Psr\Http\Message\RequestInterface; | ||
use Yoast\PHPUnitPolyfills\TestCases\TestCase; | ||
|
||
class CloudWatchLogsClientTest extends TestCase | ||
{ | ||
public function testSetStreamingFlagMiddleware() | ||
{ | ||
$client = new CloudWatchLogsClient([ | ||
'region' => 'us-east-2', | ||
'http_handler' => function (RequestInterface $request) { | ||
return new Response(200); | ||
} | ||
]); | ||
$client->getHandlerList()->appendInit(function ($handler) { | ||
return function (CommandInterface $command, $request=null) use ($handler) { | ||
self::assertNotEmpty($command['@http']['stream']); | ||
self::assertTrue($command['@http']['stream']); | ||
|
||
return $handler($command, $request); | ||
}; | ||
}); | ||
$client->startLiveTail([ | ||
'logGroupIdentifiers' => [ | ||
'arn:aws:logs:us-east-1:1234567890123:log-group:TestLogGroup' | ||
], | ||
'logStreamNames' => [ | ||
'TestLogStream' | ||
] | ||
]); | ||
} | ||
} |