# 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

> requests\_find\_by\_id(request\_id, opts)

Retrieve requests

Retrieve the properties of the specified request.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::RequestsApi.new
request_id = 'request_id_example' # String | The unique ID of the request.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56, # Integer | 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
  x_contract_number: 56 # Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
}

begin
  # Retrieve requests
  result = api_instance.requests_find_by_id(request_id, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling RequestsApi->requests_find_by_id: #{e}"
end
```

#### Using the requests\_find\_by\_id\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> requests\_find\_by\_id\_with\_http\_info(request\_id, opts)

```ruby
begin
  # Retrieve requests
  data, status_code, headers = api_instance.requests_find_by_id_with_http_info(request_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Request>
rescue Ionoscloud::ApiError => e
  puts "Error when calling RequestsApi->requests_find_by_id_with_http_info: #{e}"
end
```

### Parameters

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

### Return type

[**Request**](/ruby-sdk/models/request.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

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

## requests\_get

> requests\_get(opts)

List requests

List all API requests.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::RequestsApi.new
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56, # Integer | 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
  x_contract_number: 56, # Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
  filter_status: 'filter_status_example', # String | Filter the list by request status [QUEUED, RUNNING, DONE, FAILED]. Filter is not affected by the depth query parameter.
  filter_created_after: 'filter_created_after_example', # String | 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.
  filter_created_before: 'filter_created_before_example', # String | 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.
  filter_created_date: 'filter_created_date_example', # String | 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.
  filter_created_by: 'filter_created_by_example', # String | 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. 
  filter_etag: 'filter_etag_example', # String | 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. 
  filter_request_status: 'filter_request_status_example', # String | 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. 
  filter_method: 'filter_method_example', # String | 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. 
  filter_headers: 'filter_headers_example', # String | 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. 
  filter_body: 'filter_body_example', # String | 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. 
  filter_url: 'filter_url_example', # String | 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. 
  offset: 56, # Integer | 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).
  limit: 56 # Integer | The maximum number of elements to return (use together with offset for pagination).
}

begin
  # List requests
  result = api_instance.requests_get(opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling RequestsApi->requests_get: #{e}"
end
```

#### Using the requests\_get\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> requests\_get\_with\_http\_info(opts)

```ruby
begin
  # List requests
  data, status_code, headers = api_instance.requests_get_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Requests>
rescue Ionoscloud::ApiError => e
  puts "Error when calling RequestsApi->requests_get_with_http_info: #{e}"
end
```

### Parameters

| Name                        | Type        | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                         |
| --------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| **pretty**                  | **Boolean** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional]\[default to true] |
| **depth**                   | **Integer** | 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**     | **Integer** | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                   |
| **filter\_status**          | **String**  | Filter the list by request status \[QUEUED, RUNNING, DONE, FAILED]. Filter is not affected by the depth query parameter.                                                                                                                                                                                                                                                                                                                 | \[optional]                   |
| **filter\_created\_after**  | **String**  | 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** | **String**  | 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**   | **String**  | 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**     | **String**  | 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**            | **String**  | 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** | **String**  | 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**          | **String**  | 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**         | **String**  | 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**            | **String**  | 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**             | **String**  | 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**                  | **Integer** | 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**                   | **Integer** | The maximum number of elements to return (use together with offset for pagination).                                                                                                                                                                                                                                                                                                                                                      | \[optional]\[default to 1000] |

### Return type

[**Requests**](/ruby-sdk/models/requests.md)

### Authorization

Basic Authentication, Token Authentication

### HTTP request headers

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

## requests\_status\_get

> requests\_status\_get(request\_id, opts)

Retrieve request status

Retrieve the status of the specified request.

### Examples

```ruby
require 'time'
require 'ionoscloud'
# setup authorization
Ionoscloud.configure do |config|
  # Configure HTTP basic authorization: Basic Authentication
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token Authentication
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Ionoscloud::RequestsApi.new
request_id = 'request_id_example' # String | The unique ID of the request.
opts = {
  pretty: true, # Boolean | Controls whether the response is pretty-printed (with indentations and new lines).
  depth: 56, # Integer | 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
  x_contract_number: 56 # Integer | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
}

begin
  # Retrieve request status
  result = api_instance.requests_status_get(request_id, opts)
  p result
rescue Ionoscloud::ApiError => e
  puts "Error when calling RequestsApi->requests_status_get: #{e}"
end
```

#### Using the requests\_status\_get\_with\_http\_info variant

This returns an Array which contains the response data, status code and headers.

> \<Array(, Integer, Hash)> requests\_status\_get\_with\_http\_info(request\_id, opts)

```ruby
begin
  # Retrieve request status
  data, status_code, headers = api_instance.requests_status_get_with_http_info(request_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <RequestStatus>
rescue Ionoscloud::ApiError => e
  puts "Error when calling RequestsApi->requests_status_get_with_http_info: #{e}"
end
```

### Parameters

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

### Return type

[**RequestStatus**](/ruby-sdk/models/requeststatus.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/ruby-sdk/api/requestsapi.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.
