Skip to content

Latest commit

 

History

History
98 lines (63 loc) · 2.63 KB

VPSOSTemplatesApi.md

File metadata and controls

98 lines (63 loc) · 2.63 KB

Hostinger\VPSOSTemplatesApi

All URIs are relative to https://developers.hostinger.com, except if the operation defines another base path.

Method HTTP request Description
getTemplateListV1() GET /api/vps/v1/templates Get template list
getTemplateV1() GET /api/vps/v1/templates/{templateId} Get template

getTemplateListV1()

getTemplateListV1(): \Hostinger\Model\VPSV1TemplateTemplateResource[]

Get template list

This endpoint retrieves a list of available OS templates for virtual machines.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Hostinger\Api\VPSOSTemplatesApi(config: $config);

try {
    $result = $apiInstance->getTemplateListV1();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VPSOSTemplatesApi->getTemplateListV1: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

\Hostinger\Model\VPSV1TemplateTemplateResource[]

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getTemplateV1()

getTemplateV1($templateId): \Hostinger\Model\VPSV1TemplateTemplateResource

Get template

This endpoint retrieves details of a specific OS template for virtual machines.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Hostinger\Api\VPSOSTemplatesApi(config: $config);
$templateId = 2868928; // int | Template ID

try {
    $result = $apiInstance->getTemplateV1($templateId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VPSOSTemplatesApi->getTemplateV1: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
templateId int Template ID

Return type

\Hostinger\Model\VPSV1TemplateTemplateResource

[Back to top] [Back to API list] [Back to Model list] [Back to README]