Operation showMachineAsyncWithHttpInfo

Show machine information

@param string $machineId Id of the machine to show (required)
@throws \InvalidArgumentException
@return \GuzzleHttp\Promise\PromiseInterface
547232
public function showMachineAsyncWithHttpInfo($machineId)
    {
        $returnType = '\Gamingsolved\Paperspace\Api\Client\Version0_1_3\Model\Machine';
        $request = $this->showMachineRequest($machineId);

        return $this->client->sendAsync($request)->then(function ($response) use ($returnType) {
            $responseBody = $response->getBody();
            if ($returnType === '\SplFileObject') {
                $content = $responseBody; //stream goes to serializer
            } else {
                $content = $responseBody->getContents();
                if ($returnType !== 'string') {
                    $content = json_decode($content);
                }
            }

            return [
                ObjectSerializer::deserialize($content, $returnType, []),
                $response->getStatusCode(),
                $response->getHeaders()
            ];
        }, function ($exception) {
            $response = $exception->getResponse();
            $statusCode = $response->getStatusCode();
            throw new ApiException(
                "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})",
                $statusCode,
                $response->getHeaders(),
                $response->getBody()
            );
        });
    }
636122
public function show($docID = null, array $parameters = array(), $mime = CoderManager::MIME_JSON) {
    if (empty($docID)) {
      $response = $this->_send(self::METHOD_GET, $docID, $parameters);
    } else {
      $response = $this->_send(self::METHOD_POST, $docID, $parameters);
    }
    return $this->_parse($response, __FUNCTION__, $mime);
  }
702531
public function __async_publish($materialId)
    {
        /** @var array $result Asynchronous controller result */
        $result = array('status' => false);
        /** @var Entity $material SamsonCMS Material object */
        $material = null;

        // Call default async action
        if ($this->findAsyncEntityByID($materialId, $material, $result)) {
            // Toggle material published status
            $material->Published = $material->Published ? 0 : 1;

            // Save changes to DB
            $material->save();
        }

        // Return asynchronous result
        return $result;
    }
123786
def this_machine(self, machineid=None):
        
        if machineid is None:
            machineid = _id128.get_machine().hex
        else:
            machineid = getattr(machineid, 'hex', machineid)
        self.add_match(_MACHINE_ID=machineid)
387335
public function showAction(Request $request, $mediaId)
    {
        $em = $this->getDoctrine()->getManager();

        /* @var Media $media */
        $media = $em->getRepository('VictoireMediaBundle:Media')->getMedia($mediaId);
        $folder = $media->getFolder();

        /* @var MediaManager $mediaManager */
        $mediaManager = $this->get('victoire_media.media_manager');
        $handler = $mediaManager->getHandler($media);
        $helper = $handler->getFormHelper($media);

        $form = $this->createForm($handler->getFormType(), $helper);

        if ('POST' == $request->getMethod()) {
            $form->handleRequest($request);
            if ($form->isValid()) {
                $media = $helper->getMedia();
                $em->getRepository('VictoireMediaBundle:Media')->save($media);

                return new RedirectResponse($this->generateUrl('VictoireMediaBundle_media_show', ['mediaId' => $media->getId()]));
            }
        }
        $showTemplate = $mediaManager->getHandler($media)->getShowTemplate($media);

        return $this->render($showTemplate, [
                'handler'      => $handler,
                'mediamanager' => $this->get('victoire_media.media_manager'),
                'editform'     => $form->createView(),
                'media'        => $media,
                'helper'       => $helper,
                'folder'       => $folder, ]);
    }
858280
public function __async_copy($materialId)
    {
        /** @var array $result Asynchronous controller result */
        $result = array('status' => false);
        /** @var Entity $material Material object to copy */
        $material = null;

        // Call default async action
        if ($this->findAsyncEntityByID($materialId, $material, $result)) {
            // Copy found material
            $material->copy();
        }

        // Return asynchronous result
        return $result;
    }
1185606
public function show($id)
    {
        $todo = $this->client->get(
            sprintf('buckets/%d/todos/%d.json', $this->bucket, $id)
        );

        return new Todo($this->response($todo));
    }
118569
public function listSubCollectionsAction($collectionId)
    {
        $pager = $this->get('sonata.classification.manager.collection')
            ->getSubCollectionsPager($collectionId, $this->getCurrentRequest()->get('page'));

        return $this->render('SonataProductBundle:Collection:list_sub_collections.html.twig', [
            'pager' => $pager,
        ]);
    }
1210217
public function show($id)
    {
        $upload = $this->client->get(
            sprintf('buckets/%d/uploads/%d.json', $this->bucket, $id)
        );

        return new Upload($this->response($upload));
    }
941993
public function actionImageProvider($machine, $buildToken, $imageId)
    {
        $build = $this->ensureBuild($machine, $buildToken);
    
        if ($build) {
            if (!is_numeric($imageId)) {
                throw new ForbiddenHttpException("Invalid image id input.");
            }
    
            $image = Yii::$app->storage->getImage($imageId);
            /* @var $image \luya\admin\image\Item */
            if ($image->fileExists) {
                return Yii::$app->response->sendFile($image->serverSource)->send();
            }
            
            throw new NotFoundHttpException("The requested image '".$image->serverSource."' does not exist in the storage folder.");
        }
    }
274862
protected function mapMachineDataResult(array $machineData): array
    {
        $result = [];
        foreach ($machineData as $data) {
            $result[] = MachineData::createFromArray($data);
        }
        return $result;
    }
603962
public function show($id, $translationId)
    {
        $file = $this->getFile($id);
        if (!empty($file)) {
            $this->authorize('read', $file);
            $translation = $this->repository->getFileTranslationById($file, $translationId);
            if (!empty($translation)) {
                return $this->respondWithSuccess($translation, new FileTranslationTransformer);
            }
        }
        return $this->respondNotFound();
    }
485021
public function load($objectID) {
        $category = new CMDBCategory($this->api);
        $netInfo = $category->read($objectID, 'C__CATS__NET');

        if (count($netInfo) !== 1 ||
            !array_key_exists(0, $netInfo) ||
            !is_array($netInfo[0])) {
            throw new RuntimeException(sprintf(
                'Nothing found for object identifier %s',
                $objectID
            ));
        }

        if (!array_key_exists('type', $netInfo[0]) ||
            !is_array($netInfo[0]['type']) ||
            !array_key_exists('const', $netInfo[0]['type']) ||
            !is_string($netInfo[0]['type']['const']) ||
            $netInfo[0]['type']['const'] !== 'C__CATS_NET_TYPE__IPV4') {
            throw new RuntimeException('Works only for IPv4');
        }

        if (!array_key_exists('range_from', $netInfo[0]) ||
            !is_string($netInfo[0]['range_from']) ||
            !array_key_exists('range_to', $netInfo[0]) ||
            !is_string($netInfo[0]['range_to'])) {
            throw new RuntimeException(sprintf(
                'Subnet #%s has no IP address range',
                $objectID
            ));
        }

        $this->first = $this->convertIPv4Address($netInfo[0]['range_from']);
        $this->last = $this->convertIPv4Address($netInfo[0]['range_to']);

        $takenIPAddresses = $category->read($objectID, 'C__CATS__NET_IP_ADDRESSES');

        foreach ($takenIPAddresses as $takenIPAddress) {
            $this->taken[] = $takenIPAddress['title'];
        }

        $this->current = $this->first;

        return $this;
    }
548603
public function getShowById($showId)
  {
    $response = $this->request('/GetShowById/' . $showId);
    if ( $response->response->status == 'false' )
      return null;
    $show     = $response->response;

    $show = $this->formatShow($show);

    return $show;
  }
272262
public function getVerification($messageId)
    {
        $verification = $this->factory->createEmptyVerification();
        $verification->populate($messageId);

        return $verification;
    }
256242
@Override
	public MachineConfigurator machineConfigurator( TargetHandlerParameters parameters, String machineId ) {
		return new OpenstackMachineConfigurator(
				parameters.getTargetProperties(),
				machineId,
				parameters.getApplicationName(),
				parameters.getScopedInstance());
	}
407628
public function sendSmsCampaignNowAsyncWithHttpInfo($campaignId)
    {
        $returnType = '';
        $request = $this->sendSmsCampaignNowRequest($campaignId);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }