# RequestsApi

## RequestsApi

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

| Method                                             | HTTP request                         | Description             |
| -------------------------------------------------- | ------------------------------------ | ----------------------- |
| [**requests\_find\_by\_id**](#requests_find_by_id) | **GET** /requests/{requestId}        | Retrieve requests       |
| [**requests\_get**](#requests_get)                 | **GET** /requests                    | List requests           |
| [**requests\_status\_get**](#requests_status_get)  | **GET** /requests/{requestId}/status | Retrieve request status |

## **requests\_find\_by\_id**

> Request requests\_find\_by\_id(request\_id, pretty=pretty, depth=depth, x\_contract\_number=x\_contract\_number)

Retrieve requests

Retrieve the properties of the specified request.

#### 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.RequestsApi(api_client)
    request_id = 'request_id_example' # str | The unique ID of the request.
    try:
        # Retrieve requests
        api_response = api_instance.requests_find_by_id(request_id)
        print(api_response)
    except ApiException as e:
        print('Exception when calling RequestsApi.requests_find_by_id: %s\n' % e)
```

#### Parameters

| Name                    | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ----------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **request\_id**         | **str**  | The unique ID of the request.                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **pretty**              | **bool** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to True] |
| **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]    |
| **x\_contract\_number** | **int**  | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

[**Request**](https://docs.ionos.com/sections-test/python-sdk/cloud-api-python-sdk/models/request)

#### Authorization

Basic Authentication, Token Authentication

#### HTTP request headers

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

## **requests\_get**

> Requests requests\_get(pretty=pretty, depth=depth, x\_contract\_number=x\_contract\_number, filter\_status=filter\_status, filter\_created\_after=filter\_created\_after, filter\_created\_before=filter\_created\_before, filter\_created\_date=filter\_created\_date, filter\_created\_by=filter\_created\_by, filter\_etag=filter\_etag, filter\_request\_status=filter\_request\_status, filter\_method=filter\_method, filter\_headers=filter\_headers, filter\_body=filter\_body, filter\_url=filter\_url, offset=offset, limit=limit)

List requests

List all API requests.

#### 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.RequestsApi(api_client)
    try:
        # List requests
        api_response = api_instance.requests_get()
        print(api_response)
    except ApiException as e:
        print('Exception when calling RequestsApi.requests_get: %s\n' % e)
```

#### Parameters

| Name                        | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| --------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **pretty**                  | **bool** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to True] |
| **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]    |
| **x\_contract\_number**     | **int**  | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |
| **filter\_status**          | **str**  | Filter the list by request status \[QUEUED, RUNNING, DONE, FAILED]. Filter is not affected by the depth query parameter.                                                                                                                                                                                                                                                                                                                 | \[optional]                    |
| **filter\_created\_after**  | **str**  | Filter the list to only include the requests created after the date, specified in the yyyy-MM-dd HH:mm:ss format. Filter is not affected by the depth query parameter.                                                                                                                                                                                                                                                                   | \[optional]                    |
| **filter\_created\_before** | **str**  | Filter the list to only include the requests created before the date, specified in the yyyy-MM-dd HH:mm:ss format. Filter is not affected by the depth query parameter.                                                                                                                                                                                                                                                                  | \[optional]                    |
| **filter\_created\_date**   | **str**  | Filter the list to only include the requests that contain the createdDate, specified in the yyyy-MM-dd HH:mm:ss format. The value is not case-sensitive, and the filter requires that the depth query parameter value is greater than zero.                                                                                                                                                                                              | \[optional]                    |
| **filter\_created\_by**     | **str**  | Filter the list to only include the requests that contain the createdBy, specified in the yyyy-MM-dd HH:mm:ss format. The value is not case-sensitive, and the filter requires that the depth query parameter value is greater than zero.                                                                                                                                                                                                | \[optional]                    |
| **filter\_etag**            | **str**  | Filter the list to only include the requests that contain the specified etag. The value is not case-sensitive, and the filter requires that the depth query parameter value is greater than zero.                                                                                                                                                                                                                                        | \[optional]                    |
| **filter\_request\_status** | **str**  | Filter the list to only include the requests that contain the specified requestStatus. The value is not case-sensitive, and the filter requires that the depth query parameter value is greater than zero.                                                                                                                                                                                                                               | \[optional]                    |
| **filter\_method**          | **str**  | Filter the list to only include the requests that contain the specified method. The value is not case-sensitive, and the filter requires that the depth query parameter value is greater than zero.                                                                                                                                                                                                                                      | \[optional]                    |
| **filter\_headers**         | **str**  | Filter the list to only include the requests that contain the specified headers. The value is not case-sensitive, and the filter requires that the depth query parameter value is greater than zero.                                                                                                                                                                                                                                     | \[optional]                    |
| **filter\_body**            | **str**  | Filter the list to only include the requests that contain the specified body. The value is not case-sensitive, and the filter requires that the depth query parameter value is greater than zero.                                                                                                                                                                                                                                        | \[optional]                    |
| **filter\_url**             | **str**  | Filter the list to only include the requests that contain the specified URL. The value is not case-sensitive, and the filter requires that the depth query parameter value is greater than zero.                                                                                                                                                                                                                                         | \[optional]                    |
| **offset**                  | **int**  | The first element (from the complete list of the elements) to include in the response (used together with \<b>\<i>limit\</i>\</b> for pagination).                                                                                                                                                                                                                                                                                       | \[optional] \[default to 0]    |
| **limit**                   | **int**  | The maximum number of elements to return (use together with offset for pagination).                                                                                                                                                                                                                                                                                                                                                      | \[optional] \[default to 1000] |

#### Return type

[**Requests**](https://docs.ionos.com/sections-test/python-sdk/cloud-api-python-sdk/models/requests)

#### Authorization

Basic Authentication, Token Authentication

#### HTTP request headers

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

## **requests\_status\_get**

> RequestStatus requests\_status\_get(request\_id, pretty=pretty, depth=depth, x\_contract\_number=x\_contract\_number)

Retrieve request status

Retrieve the status of the specified request.

#### 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.RequestsApi(api_client)
    request_id = 'request_id_example' # str | The unique ID of the request.
    try:
        # Retrieve request status
        api_response = api_instance.requests_status_get(request_id)
        print(api_response)
    except ApiException as e:
        print('Exception when calling RequestsApi.requests_status_get: %s\n' % e)
```

#### Parameters

| Name                    | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ----------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **request\_id**         | **str**  | The unique ID of the request.                                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **pretty**              | **bool** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to True] |
| **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]    |
| **x\_contract\_number** | **int**  | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

[**RequestStatus**](https://docs.ionos.com/sections-test/python-sdk/cloud-api-python-sdk/models/requeststatus)

#### Authorization

Basic Authentication, Token Authentication

#### HTTP request headers

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