Skip to content

Latest commit

 

History

History
146 lines (95 loc) · 4.1 KB

VPSOSTemplatesApi.md

File metadata and controls

146 lines (95 loc) · 4.1 KB

hostinger_api.VPSOSTemplatesApi

All URIs are relative to https://developers.hostinger.com

Method HTTP request Description
get_template_list_v1 GET /api/vps/v1/templates Get template list
get_template_v1 GET /api/vps/v1/templates/{templateId} Get template

get_template_list_v1

List[VPSV1TemplateTemplateResource] get_template_list_v1()

Get template list

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

Example

  • Bearer Authentication (apiToken):
import hostinger_api
from hostinger_api.models.vpsv1_template_template_resource import VPSV1TemplateTemplateResource
from hostinger_api.rest import ApiException
from pprint import pprint


# Configure Bearer authorization: apiToken
configuration = hostinger_api.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with hostinger_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hostinger_api.VPSOSTemplatesApi(api_client)

    try:
        # Get template list
        api_response = api_instance.get_template_list_v1()
        print("The response of VPSOSTemplatesApi->get_template_list_v1:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VPSOSTemplatesApi->get_template_list_v1: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

List[VPSV1TemplateTemplateResource]

Authorization

apiToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success response -
401 Unauthenticated -
500 Error response -

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

get_template_v1

VPSV1TemplateTemplateResource get_template_v1(template_id)

Get template

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

Example

  • Bearer Authentication (apiToken):
import hostinger_api
from hostinger_api.models.vpsv1_template_template_resource import VPSV1TemplateTemplateResource
from hostinger_api.rest import ApiException
from pprint import pprint


# Configure Bearer authorization: apiToken
configuration = hostinger_api.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with hostinger_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hostinger_api.VPSOSTemplatesApi(api_client)
    template_id = 2868928 # int | Template ID

    try:
        # Get template
        api_response = api_instance.get_template_v1(template_id)
        print("The response of VPSOSTemplatesApi->get_template_v1:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VPSOSTemplatesApi->get_template_v1: %s\n" % e)

Parameters

Name Type Description Notes
template_id int Template ID

Return type

VPSV1TemplateTemplateResource

Authorization

apiToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success response -
401 Unauthenticated -
500 Error response -

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