Code Duplication    Length = 14-15 lines in 7 locations

generated/Resource/ContainerResource.php 6 locations

@@ 269-283 (lines=15) @@
266
     *
267
     * @return \Psr\Http\Message\ResponseInterface
268
     */
269
    public function resize($id, $parameters = [], $fetch = self::FETCH_OBJECT)
270
    {
271
        $queryParam = new QueryParam();
272
        $queryParam->setDefault('h', null);
273
        $queryParam->setDefault('w', null);
274
        $url      = '/containers/{id}/resize';
275
        $url      = str_replace('{id}', $id, $url);
276
        $url      = $url . ('?' . $queryParam->buildQueryString($parameters));
277
        $headers  = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
278
        $body     = $queryParam->buildFormDataString($parameters);
279
        $request  = $this->messageFactory->createRequest('POST', $url, $headers, $body);
280
        $response = $this->httpClient->sendRequest($request);
281
282
        return $response;
283
    }
284
285
    /**
286
     * Start the container id.
@@ 242-255 (lines=14) @@
239
     *
240
     * @return \Psr\Http\Message\ResponseInterface
241
     */
242
    public function stats($id, $parameters = [], $fetch = self::FETCH_OBJECT)
243
    {
244
        $queryParam = new QueryParam();
245
        $queryParam->setDefault('stream', null);
246
        $url      = '/containers/{id}/stats';
247
        $url      = str_replace('{id}', $id, $url);
248
        $url      = $url . ('?' . $queryParam->buildQueryString($parameters));
249
        $headers  = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
250
        $body     = $queryParam->buildFormDataString($parameters);
251
        $request  = $this->messageFactory->createRequest('GET', $url, $headers, $body);
252
        $response = $this->httpClient->sendRequest($request);
253
254
        return $response;
255
    }
256
257
    /**
258
     * Resize the TTY for container with id. The unit is number of characters. You must restart the container for the resize to take effect.
@@ 319-332 (lines=14) @@
316
     *
317
     * @return \Psr\Http\Message\ResponseInterface
318
     */
319
    public function stop($id, $parameters = [], $fetch = self::FETCH_OBJECT)
320
    {
321
        $queryParam = new QueryParam();
322
        $queryParam->setDefault('t', null);
323
        $url      = '/containers/{id}/stop';
324
        $url      = str_replace('{id}', $id, $url);
325
        $url      = $url . ('?' . $queryParam->buildQueryString($parameters));
326
        $headers  = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
327
        $body     = $queryParam->buildFormDataString($parameters);
328
        $request  = $this->messageFactory->createRequest('POST', $url, $headers, $body);
329
        $response = $this->httpClient->sendRequest($request);
330
331
        return $response;
332
    }
333
334
    /**
335
     * Restart the container id.
@@ 345-358 (lines=14) @@
342
     *
343
     * @return \Psr\Http\Message\ResponseInterface
344
     */
345
    public function restart($id, $parameters = [], $fetch = self::FETCH_OBJECT)
346
    {
347
        $queryParam = new QueryParam();
348
        $queryParam->setDefault('t', null);
349
        $url      = '/containers/{id}/restart';
350
        $url      = str_replace('{id}', $id, $url);
351
        $url      = $url . ('?' . $queryParam->buildQueryString($parameters));
352
        $headers  = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
353
        $body     = $queryParam->buildFormDataString($parameters);
354
        $request  = $this->messageFactory->createRequest('POST', $url, $headers, $body);
355
        $response = $this->httpClient->sendRequest($request);
356
357
        return $response;
358
    }
359
360
    /**
361
     * Send a posix signal to a container.
@@ 371-384 (lines=14) @@
368
     *
369
     * @return \Psr\Http\Message\ResponseInterface
370
     */
371
    public function kill($id, $parameters = [], $fetch = self::FETCH_OBJECT)
372
    {
373
        $queryParam = new QueryParam();
374
        $queryParam->setDefault('signal', null);
375
        $url      = '/containers/{id}/kill';
376
        $url      = str_replace('{id}', $id, $url);
377
        $url      = $url . ('?' . $queryParam->buildQueryString($parameters));
378
        $headers  = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
379
        $body     = $queryParam->buildFormDataString($parameters);
380
        $request  = $this->messageFactory->createRequest('POST', $url, $headers, $body);
381
        $response = $this->httpClient->sendRequest($request);
382
383
        return $response;
384
    }
385
386
    /**
387
     * Rename the container id to a new_name.
@@ 566-580 (lines=15) @@
563
     *
564
     * @return \Psr\Http\Message\ResponseInterface
565
     */
566
    public function remove($id, $parameters = [], $fetch = self::FETCH_OBJECT)
567
    {
568
        $queryParam = new QueryParam();
569
        $queryParam->setDefault('v', null);
570
        $queryParam->setDefault('force', null);
571
        $url      = '/containers/{id}';
572
        $url      = str_replace('{id}', $id, $url);
573
        $url      = $url . ('?' . $queryParam->buildQueryString($parameters));
574
        $headers  = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
575
        $body     = $queryParam->buildFormDataString($parameters);
576
        $request  = $this->messageFactory->createRequest('DELETE', $url, $headers, $body);
577
        $response = $this->httpClient->sendRequest($request);
578
579
        return $response;
580
    }
581
582
    /**
583
     * Get an tar archive of a resource in the filesystem of container id.

generated/Resource/ExecResource.php 1 location

@@ 82-95 (lines=14) @@
79
     *
80
     * @return \Psr\Http\Message\ResponseInterface
81
     */
82
    public function resize($id, $parameters = [], $fetch = self::FETCH_OBJECT)
83
    {
84
        $queryParam = new QueryParam();
85
        $queryParam->setDefault('w', null);
86
        $url      = '/exec/{id}/resize';
87
        $url      = str_replace('{id}', $id, $url);
88
        $url      = $url . ('?' . $queryParam->buildQueryString($parameters));
89
        $headers  = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
90
        $body     = $queryParam->buildFormDataString($parameters);
91
        $request  = $this->messageFactory->createRequest('POST', $url, $headers, $body);
92
        $response = $this->httpClient->sendRequest($request);
93
94
        return $response;
95
    }
96
97
    /**
98
     * Return low-level information about the exec command id.