# TemplatesApi

## TemplatesApi

All URIs are relative to *<https://api.ionos.com/cloudapi/v6>*

| Method                                               | HTTP request                    | Description              |
| ---------------------------------------------------- | ------------------------------- | ------------------------ |
| [**templates\_find\_by\_id**](#templates_find_by_id) | **GET** /templates/{templateId} | Get Cubes Template by ID |
| [**templates\_get**](#templates_get)                 | **GET** /templates              | Get Cubes Templates      |

## **templates\_find\_by\_id**

> Template templates\_find\_by\_id(template\_id, depth=depth)

Get Cubes Template by ID

Retrieves the properties of the Cubes template specified by its ID.

#### Example

```python
from __future__ import print_function
import time
import ionoscloud
from ionoscloud.rest import ApiException

# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6
configuration = ionoscloud.Configuration(
    host = 'https://api.ionos.com/cloudapi/v6',
)

# Example of configuring HTTP Basic Authorization
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

with ionoscloud.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ionoscloud.TemplatesApi(api_client)
    template_id = 'template_id_example' # str | The unique template ID.
    try:
        # Get Cubes Template by ID
        api_response = api_instance.templates_find_by_id(template_id)
        print(api_response)
    except ApiException as e:
        print('Exception when calling TemplatesApi.templates_find_by_id: %s\n' % e)
```

#### Parameters

| Name             | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                       |
| ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
| **template\_id** | **str** | The unique template ID.                                                                                                                                                                                                                                                                                                                                                                                                                  |                             |
| **depth**        | **int** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0] |

#### Return type

[**Template**](/python-sdk/models/template.md)

#### Authorization

Basic Authentication, Token Authentication

#### HTTP request headers

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

## **templates\_get**

> Templates templates\_get(depth=depth)

Get Cubes Templates

Retrieves all available templates. Templates provide a pre-defined configuration for Cube servers. >Templates are read-only and cannot be created, modified, or deleted by users.

#### Example

```python
from __future__ import print_function
import time
import ionoscloud
from ionoscloud.rest import ApiException

# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6
configuration = ionoscloud.Configuration(
    host = 'https://api.ionos.com/cloudapi/v6',
)

# Example of configuring HTTP Basic Authorization
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

with ionoscloud.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ionoscloud.TemplatesApi(api_client)
    try:
        # Get Cubes Templates
        api_response = api_instance.templates_get()
        print(api_response)
    except ApiException as e:
        print('Exception when calling TemplatesApi.templates_get: %s\n' % e)
```

#### Parameters

| Name      | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                       |
| --------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
| **depth** | **int** | Controls the detail depth of the response objects. GET /datacenters/\[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on | \[optional] \[default to 0] |

#### Return type

[**Templates**](/python-sdk/models/templates.md)

#### Authorization

Basic Authentication, Token Authentication

#### HTTP request headers

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/python-sdk/api/templatesapi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
