# 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**](https://docs.ionos.com/sections-test/python-sdk/cloud-api-python-sdk/models/template)

#### 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**](https://docs.ionos.com/sections-test/python-sdk/cloud-api-python-sdk/models/templates)

#### Authorization

Basic Authentication, Token Authentication

#### HTTP request headers

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