Docker\API\Resource\MiscResource::getSystemInformation PHP Method

getSystemInformation() public method

Display system-wide information.
public getSystemInformation ( array $parameters = [], string $fetch = self::FETCH_OBJECT ) : Psr\Http\Message\ResponseInterface | SystemInformation
$parameters array List of parameters
$fetch string Fetch mode (object or response)
return Psr\Http\Message\ResponseInterface | Docker\API\Model\SystemInformation
    public function getSystemInformation($parameters = [], $fetch = self::FETCH_OBJECT)
    {
        $queryParam = new QueryParam();
        $url = '/info';
        $url = $url . ('?' . $queryParam->buildQueryString($parameters));
        $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
        $body = $queryParam->buildFormDataString($parameters);
        $request = $this->messageFactory->createRequest('GET', $url, $headers, $body);
        $response = $this->httpClient->sendRequest($request);
        if (self::FETCH_OBJECT == $fetch) {
            if ('200' == $response->getStatusCode()) {
                return $this->serializer->deserialize((string) $response->getBody(), 'Docker\\API\\Model\\SystemInformation', 'json');
            }
        }
        return $response;
    }