-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathLogs.php
57 lines (51 loc) · 1.47 KB
/
Logs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
namespace AcquiaCloudApi\Endpoints;
use AcquiaCloudApi\Response\LogResponse;
use AcquiaCloudApi\Response\LogsResponse;
use AcquiaCloudApi\Response\LogstreamResponse;
use AcquiaCloudApi\Response\OperationResponse;
use Psr\Http\Message\StreamInterface;
/**
* Class Logs
*
* @package AcquiaCloudApi\CloudApi
*/
class Logs extends CloudApiBase
{
/**
* Returns a list of log files available for download.
*
* @return LogsResponse<LogResponse>
*/
public function getAll(string $environmentUuid): LogsResponse
{
return new LogsResponse(
$this->client->request('get', "/environments/$environmentUuid/logs")
);
}
/**
* Downloads a log file.
*/
public function download(string $environmentUuid, string $logType): StreamInterface
{
return $this->client->stream('get', "/environments/$environmentUuid/logs/$logType");
}
/**
* Returns logstream WSS stream information.
*/
public function stream(string $environmentUuid): LogstreamResponse
{
return new LogstreamResponse(
$this->client->request('get', "/environments/$environmentUuid/logstream")
);
}
/**
* Creates a log file snapshot.
*/
public function snapshot(string $environmentUuid, string $logType): OperationResponse
{
return new OperationResponse(
$this->client->request('post', "/environments/$environmentUuid/logs/$logType")
);
}
}