# GroupsApi

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

| Method                                                          | HTTP request                                 | Description                         |
| --------------------------------------------------------------- | -------------------------------------------- | ----------------------------------- |
| [**groups\_actions\_find\_by\_id**](#groups_actions_find_by_id) | **GET** /groups/{groupId}/actions/{actionId} | Get Scaling Action Details by ID    |
| [**groups\_actions\_get**](#groups_actions_get)                 | **GET** /groups/{groupId}/actions            | Get Scaling Actions                 |
| [**groups\_delete**](#groups_delete)                            | **DELETE** /groups/{groupId}                 | Delete an Auto Scaling Group by ID  |
| [**groups\_find\_by\_id**](#groups_find_by_id)                  | **GET** /groups/{groupId}                    | Get an Auto Scaling by ID           |
| [**groups\_get**](#groups_get)                                  | **GET** /groups                              | Get Auto Scaling Groups             |
| [**groups\_post**](#groups_post)                                | **POST** /groups                             | Create an Auto Scaling Group        |
| [**groups\_put**](#groups_put)                                  | **PUT** /groups/{groupId}                    | Update an Auto Scaling Group by ID  |
| [**groups\_servers\_find\_by\_id**](#groups_servers_find_by_id) | **GET** /groups/{groupId}/servers/{serverId} | Get Auto Scaling Group Server by ID |
| [**groups\_servers\_get**](#groups_servers_get)                 | **GET** /groups/{groupId}/servers            | Get Auto Scaling Group Servers      |

## groups\_actions\_find\_by\_id

> groups\_actions\_find\_by\_id(action\_id, group\_id, opts)

Get Scaling Action Details by ID

Retrieves the details of a scaling action specified by its ID. This operation returns metadata, properties, and the current status, for the specified scaling action

### Examples

```ruby
require 'time'
require 'ionoscloud-vm-autoscaling'
# setup authorization
IonoscloudVmAutoscaling.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: tokenAuth
  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 = IonoscloudVmAutoscaling::GroupsApi.new
action_id = TODO # String | 
group_id = 'group_id_example' # String | 
opts = {
  depth: 8.14 # Float | With this parameter, you control the level of detail of the response objects:    - ``0``: Only direct properties are included; children (such as executions or transitions) are not considered.    - ``1``: Direct properties and children references are included.    - ``2``: Direct properties and children properties are included.    - ``3``: Direct properties and children properties and children's children are included.    - etc.  
}

begin
  # Get Scaling Action Details by ID
  result = api_instance.groups_actions_find_by_id(action_id, group_id, opts)
  p result
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_actions_find_by_id: #{e}"
end
```

#### Using the groups\_actions\_find\_by\_id\_with\_http\_info variant

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

> \<Array(, Integer, Hash)> groups\_actions\_find\_by\_id\_with\_http\_info(action\_id, group\_id, opts)

```ruby
begin
  # Get Scaling Action Details by ID
  data, status_code, headers = api_instance.groups_actions_find_by_id_with_http_info(action_id, group_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Action>
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_actions_find_by_id_with_http_info: #{e}"
end
```

### Parameters

| Name           | Type                                                                                                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                    | Notes       |
| -------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| **action\_id** | [**String**](https://github.com/ionos-cloud/sdk-ruby-vm-autoscaling/blob/master/docs/models/.md/README.md) |                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| **group\_id**  | **String**                                                                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| **depth**      | **Float**                                                                                                  | With this parameter, you control the level of detail of the response objects: - \`\`0\`\`: Only direct properties are included; children (such as executions or transitions) are not considered. - \`\`1\`\`: Direct properties and children references are included. - \`\`2\`\`: Direct properties and children properties are included. - \`\`3\`\`: Direct properties and children properties and children's children are included. - etc. | \[optional] |

### Return type

[**Action**](https://docs.ionos.com/sections-test/ruby-sdk/vm-autoscaling-ruby-sdk/models/action)

### Authorization

basicAuth, tokenAuth

### HTTP request headers

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

## groups\_actions\_get

> groups\_actions\_get(group\_id, opts)

Get Scaling Actions

Retrieves the list of the scaling actions for the Auto Scaling group specified by its ID. >Note that currently, only the last ten actions are returned.

### Examples

```ruby
require 'time'
require 'ionoscloud-vm-autoscaling'
# setup authorization
IonoscloudVmAutoscaling.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: tokenAuth
  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 = IonoscloudVmAutoscaling::GroupsApi.new
group_id = 'group_id_example' # String | 
opts = {
  depth: 8.14, # Float | With this parameter, you control the level of detail of the response objects:    - ``0``: Only direct properties are included; children (such as executions or transitions) are not considered.    - ``1``: Direct properties and children references are included.    - ``2``: Direct properties and children properties are included.    - ``3``: Direct properties and children properties and children's children are included.    - etc.  
  order_by: 'order_by_example' # String | Use this parameter to specify by which the returned list should be sorted. Valid values are: ``createdDate`` and ``lastModifiedDate``.
}

begin
  # Get Scaling Actions
  result = api_instance.groups_actions_get(group_id, opts)
  p result
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_actions_get: #{e}"
end
```

#### Using the groups\_actions\_get\_with\_http\_info variant

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

> \<Array(, Integer, Hash)> groups\_actions\_get\_with\_http\_info(group\_id, opts)

```ruby
begin
  # Get Scaling Actions
  data, status_code, headers = api_instance.groups_actions_get_with_http_info(group_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ActionCollection>
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_actions_get_with_http_info: #{e}"
end
```

### Parameters

| Name          | Type       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                    | Notes                                  |
| ------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
| **group\_id** | **String** |                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                        |
| **depth**     | **Float**  | With this parameter, you control the level of detail of the response objects: - \`\`0\`\`: Only direct properties are included; children (such as executions or transitions) are not considered. - \`\`1\`\`: Direct properties and children references are included. - \`\`2\`\`: Direct properties and children properties are included. - \`\`3\`\`: Direct properties and children properties and children's children are included. - etc. | \[optional]                            |
| **order\_by** | **String** | Use this parameter to specify by which the returned list should be sorted. Valid values are: \`\`createdDate\`\` and \`\`lastModifiedDate\`\`.                                                                                                                                                                                                                                                                                                 | \[optional]\[default to 'createdDate'] |

### Return type

[**ActionCollection**](https://docs.ionos.com/sections-test/ruby-sdk/vm-autoscaling-ruby-sdk/models/actioncollection)

### Authorization

basicAuth, tokenAuth

### HTTP request headers

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

## groups\_delete

> groups\_delete(group\_id)

Delete an Auto Scaling Group by ID

Deletes the Auto Scaling group specified by its ID. >Deleting the associated servers and disks is currently not implemented.

### Examples

```ruby
require 'time'
require 'ionoscloud-vm-autoscaling'
# setup authorization
IonoscloudVmAutoscaling.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: tokenAuth
  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 = IonoscloudVmAutoscaling::GroupsApi.new
group_id = TODO # String | 

begin
  # Delete an Auto Scaling Group by ID
  api_instance.groups_delete(group_id)
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_delete: #{e}"
end
```

#### Using the groups\_delete\_with\_http\_info variant

This returns an Array which contains the response data (`nil` in this case), status code and headers.

> \<Array(nil, Integer, Hash)> groups\_delete\_with\_http\_info(group\_id)

```ruby
begin
  # Delete an Auto Scaling Group by ID
  data, status_code, headers = api_instance.groups_delete_with_http_info(group_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => nil
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_delete_with_http_info: #{e}"
end
```

### Parameters

| Name          | Type                                                                                                       | Description | Notes |
| ------------- | ---------------------------------------------------------------------------------------------------------- | ----------- | ----- |
| **group\_id** | [**String**](https://github.com/ionos-cloud/sdk-ruby-vm-autoscaling/blob/master/docs/models/.md/README.md) |             |       |

### Return type

nil (empty response body)

### Authorization

basicAuth, tokenAuth

### HTTP request headers

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

## groups\_find\_by\_id

> groups\_find\_by\_id(group\_id, opts)

Get an Auto Scaling by ID

Retrieves the Auto Scaling group specified by its ID including the details.

### Examples

```ruby
require 'time'
require 'ionoscloud-vm-autoscaling'
# setup authorization
IonoscloudVmAutoscaling.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: tokenAuth
  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 = IonoscloudVmAutoscaling::GroupsApi.new
group_id = 'group_id_example' # String | 
opts = {
  depth: 8.14 # Float | With this parameter, you control the level of detail of the response objects:    - ``0``: Only direct properties are included; children (such as executions or transitions) are not considered.    - ``1``: Direct properties and children references are included.    - ``2``: Direct properties and children properties are included.    - ``3``: Direct properties and children properties and children's children are included.    - etc.  
}

begin
  # Get an Auto Scaling by ID
  result = api_instance.groups_find_by_id(group_id, opts)
  p result
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_find_by_id: #{e}"
end
```

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

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

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

```ruby
begin
  # Get an Auto Scaling by ID
  data, status_code, headers = api_instance.groups_find_by_id_with_http_info(group_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Group>
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_find_by_id_with_http_info: #{e}"
end
```

### Parameters

| Name          | Type       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                    | Notes       |
| ------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| **group\_id** | **String** |                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| **depth**     | **Float**  | With this parameter, you control the level of detail of the response objects: - \`\`0\`\`: Only direct properties are included; children (such as executions or transitions) are not considered. - \`\`1\`\`: Direct properties and children references are included. - \`\`2\`\`: Direct properties and children properties are included. - \`\`3\`\`: Direct properties and children properties and children's children are included. - etc. | \[optional] |

### Return type

[**Group**](https://docs.ionos.com/sections-test/ruby-sdk/vm-autoscaling-ruby-sdk/models/group)

### Authorization

basicAuth, tokenAuth

### HTTP request headers

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

## groups\_get

> groups\_get(opts)

Get Auto Scaling Groups

Lists all Auto Scaling groups of your account.

### Examples

```ruby
require 'time'
require 'ionoscloud-vm-autoscaling'
# setup authorization
IonoscloudVmAutoscaling.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: tokenAuth
  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 = IonoscloudVmAutoscaling::GroupsApi.new
opts = {
  depth: 8.14, # Float | With this parameter, you control the level of detail of the response objects:    - ``0``: Only direct properties are included; children (such as executions or transitions) are not considered.    - ``1``: Direct properties and children references are included.    - ``2``: Direct properties and children properties are included.    - ``3``: Direct properties and children properties and children's children are included.    - etc.  
  order_by: 'order_by_example' # String | Use this parameter to specify by which the returned list should be sorted. Valid values are: ``createdDate`` and ``lastModifiedDate``.
}

begin
  # Get Auto Scaling Groups
  result = api_instance.groups_get(opts)
  p result
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_get: #{e}"
end
```

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

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

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

```ruby
begin
  # Get Auto Scaling Groups
  data, status_code, headers = api_instance.groups_get_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GroupCollection>
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_get_with_http_info: #{e}"
end
```

### Parameters

| Name          | Type       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                    | Notes                                  |
| ------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
| **depth**     | **Float**  | With this parameter, you control the level of detail of the response objects: - \`\`0\`\`: Only direct properties are included; children (such as executions or transitions) are not considered. - \`\`1\`\`: Direct properties and children references are included. - \`\`2\`\`: Direct properties and children properties are included. - \`\`3\`\`: Direct properties and children properties and children's children are included. - etc. | \[optional]                            |
| **order\_by** | **String** | Use this parameter to specify by which the returned list should be sorted. Valid values are: \`\`createdDate\`\` and \`\`lastModifiedDate\`\`.                                                                                                                                                                                                                                                                                                 | \[optional]\[default to 'createdDate'] |

### Return type

[**GroupCollection**](https://docs.ionos.com/sections-test/ruby-sdk/vm-autoscaling-ruby-sdk/models/groupcollection)

### Authorization

basicAuth, tokenAuth

### HTTP request headers

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

## groups\_post

> groups\_post(group\_post)

Create an Auto Scaling Group

Creates an Auto Scaling group. > Note that creating a group triggers the creation of two monitoring alarms for 'Scale-In' and 'Scale-Out' operations according to the 'Policy' settings.

### Examples

```ruby
require 'time'
require 'ionoscloud-vm-autoscaling'
# setup authorization
IonoscloudVmAutoscaling.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: tokenAuth
  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 = IonoscloudVmAutoscaling::GroupsApi.new
group_post = IonoscloudVmAutoscaling::GroupPost.new({id: '1d67ca27-d4c0-419d-9a64-9ea42dfdd036', properties: IonoscloudVmAutoscaling::GroupProperties.new({location: 'de/txl'})}) # GroupPost | 

begin
  # Create an Auto Scaling Group
  result = api_instance.groups_post(group_post)
  p result
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_post: #{e}"
end
```

#### Using the groups\_post\_with\_http\_info variant

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

> \<Array(, Integer, Hash)> groups\_post\_with\_http\_info(group\_post)

```ruby
begin
  # Create an Auto Scaling Group
  data, status_code, headers = api_instance.groups_post_with_http_info(group_post)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GroupPostResponse>
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_post_with_http_info: #{e}"
end
```

### Parameters

| Name            | Type                                                                                                    | Description | Notes |
| --------------- | ------------------------------------------------------------------------------------------------------- | ----------- | ----- |
| **group\_post** | [**GroupPost**](https://docs.ionos.com/sections-test/ruby-sdk/vm-autoscaling-ruby-sdk/models/grouppost) |             |       |

### Return type

[**GroupPostResponse**](https://docs.ionos.com/sections-test/ruby-sdk/vm-autoscaling-ruby-sdk/models/grouppostresponse)

### Authorization

basicAuth, tokenAuth

### HTTP request headers

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

## groups\_put

> groups\_put(group\_id, group\_put)

Update an Auto Scaling Group by ID

Updates the Auto Scaling group specified by its ID. The IDs assigned by the system when the resource is created, such as 'properties.datacenter.id' and 'backupunitId', are immutable and cannot be updated.

### Examples

```ruby
require 'time'
require 'ionoscloud-vm-autoscaling'
# setup authorization
IonoscloudVmAutoscaling.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: tokenAuth
  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 = IonoscloudVmAutoscaling::GroupsApi.new
group_id = TODO # String | 
group_put = IonoscloudVmAutoscaling::GroupPut.new({properties: IonoscloudVmAutoscaling::GroupPutProperties.new({location: 'de/txl', max_replica_count: 10, min_replica_count: 1, name: 'Autoscaling Group #1', policy: IonoscloudVmAutoscaling::GroupPolicy.new({metric: IonoscloudVmAutoscaling::Metric::CPU_UTILIZATION_AVERAGE, scale_in_action: IonoscloudVmAutoscaling::GroupPolicyScaleInAction.new({amount: 1, amount_type: IonoscloudVmAutoscaling::ActionAmount::ABSOLUTE, delete_volumes: true}), scale_in_threshold: 33, scale_out_action: IonoscloudVmAutoscaling::GroupPolicyScaleOutAction.new({amount: 1, amount_type: IonoscloudVmAutoscaling::ActionAmount::ABSOLUTE}), scale_out_threshold: 77, unit: IonoscloudVmAutoscaling::QueryUnit::PER_HOUR}), replica_configuration: IonoscloudVmAutoscaling::ReplicaPropertiesPost.new({cores: 2, ram: 2048})})}) # GroupPut | 

begin
  # Update an Auto Scaling Group by ID
  result = api_instance.groups_put(group_id, group_put)
  p result
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_put: #{e}"
end
```

#### Using the groups\_put\_with\_http\_info variant

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

> \<Array(, Integer, Hash)> groups\_put\_with\_http\_info(group\_id, group\_put)

```ruby
begin
  # Update an Auto Scaling Group by ID
  data, status_code, headers = api_instance.groups_put_with_http_info(group_id, group_put)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Group>
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_put_with_http_info: #{e}"
end
```

### Parameters

| Name           | Type                                                                                                       | Description | Notes |
| -------------- | ---------------------------------------------------------------------------------------------------------- | ----------- | ----- |
| **group\_id**  | [**String**](https://github.com/ionos-cloud/sdk-ruby-vm-autoscaling/blob/master/docs/models/.md/README.md) |             |       |
| **group\_put** | [**GroupPut**](https://docs.ionos.com/sections-test/ruby-sdk/vm-autoscaling-ruby-sdk/models/groupput)      |             |       |

### Return type

[**Group**](https://docs.ionos.com/sections-test/ruby-sdk/vm-autoscaling-ruby-sdk/models/group)

### Authorization

basicAuth, tokenAuth

### HTTP request headers

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

## groups\_servers\_find\_by\_id

> groups\_servers\_find\_by\_id(group\_id, server\_id, opts)

Get Auto Scaling Group Server by ID

Retrieves the properties of the server specified by its ID. >Note that the server IDs of the Auto Scaling groups are different from and do not match the VM server IDs in the data center.

### Examples

```ruby
require 'time'
require 'ionoscloud-vm-autoscaling'
# setup authorization
IonoscloudVmAutoscaling.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: tokenAuth
  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 = IonoscloudVmAutoscaling::GroupsApi.new
group_id = 'group_id_example' # String | 
server_id = TODO # String | 
opts = {
  depth: 8.14 # Float | With this parameter, you control the level of detail of the response objects:    - ``0``: Only direct properties are included; children (such as executions or transitions) are not considered.    - ``1``: Direct properties and children references are included.    - ``2``: Direct properties and children properties are included.    - ``3``: Direct properties and children properties and children's children are included.    - etc.  
}

begin
  # Get Auto Scaling Group Server by ID
  result = api_instance.groups_servers_find_by_id(group_id, server_id, opts)
  p result
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_servers_find_by_id: #{e}"
end
```

#### Using the groups\_servers\_find\_by\_id\_with\_http\_info variant

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

> \<Array(, Integer, Hash)> groups\_servers\_find\_by\_id\_with\_http\_info(group\_id, server\_id, opts)

```ruby
begin
  # Get Auto Scaling Group Server by ID
  data, status_code, headers = api_instance.groups_servers_find_by_id_with_http_info(group_id, server_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Server>
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_servers_find_by_id_with_http_info: #{e}"
end
```

### Parameters

| Name           | Type                                                                                                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                    | Notes       |
| -------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| **group\_id**  | **String**                                                                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| **server\_id** | [**String**](https://github.com/ionos-cloud/sdk-ruby-vm-autoscaling/blob/master/docs/models/.md/README.md) |                                                                                                                                                                                                                                                                                                                                                                                                                                                |             |
| **depth**      | **Float**                                                                                                  | With this parameter, you control the level of detail of the response objects: - \`\`0\`\`: Only direct properties are included; children (such as executions or transitions) are not considered. - \`\`1\`\`: Direct properties and children references are included. - \`\`2\`\`: Direct properties and children properties are included. - \`\`3\`\`: Direct properties and children properties and children's children are included. - etc. | \[optional] |

### Return type

[**Server**](https://docs.ionos.com/sections-test/ruby-sdk/vm-autoscaling-ruby-sdk/models/server)

### Authorization

basicAuth, tokenAuth

### HTTP request headers

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

## groups\_servers\_get

> groups\_servers\_get(group\_id, opts)

Get Auto Scaling Group Servers

Retrieves all servers associated with the Auto Scaling group specified by its ID. >Note that the server IDs of the Auto Scaling groups are different from and do not match the VM server IDs in the data center.

### Examples

```ruby
require 'time'
require 'ionoscloud-vm-autoscaling'
# setup authorization
IonoscloudVmAutoscaling.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: tokenAuth
  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 = IonoscloudVmAutoscaling::GroupsApi.new
group_id = 'group_id_example' # String | 
opts = {
  depth: 8.14, # Float | With this parameter, you control the level of detail of the response objects:    - ``0``: Only direct properties are included; children (such as executions or transitions) are not considered.    - ``1``: Direct properties and children references are included.    - ``2``: Direct properties and children properties are included.    - ``3``: Direct properties and children properties and children's children are included.    - etc.  
  order_by: 'order_by_example' # String | Use this parameter to specify by which the returned list should be sorted. Valid values are: ``createdDate`` and ``lastModifiedDate``.
}

begin
  # Get Auto Scaling Group Servers
  result = api_instance.groups_servers_get(group_id, opts)
  p result
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_servers_get: #{e}"
end
```

#### Using the groups\_servers\_get\_with\_http\_info variant

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

> \<Array(, Integer, Hash)> groups\_servers\_get\_with\_http\_info(group\_id, opts)

```ruby
begin
  # Get Auto Scaling Group Servers
  data, status_code, headers = api_instance.groups_servers_get_with_http_info(group_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ServerCollection>
rescue IonoscloudVmAutoscaling::ApiError => e
  puts "Error when calling GroupsApi->groups_servers_get_with_http_info: #{e}"
end
```

### Parameters

| Name          | Type       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                    | Notes                                  |
| ------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
| **group\_id** | **String** |                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                        |
| **depth**     | **Float**  | With this parameter, you control the level of detail of the response objects: - \`\`0\`\`: Only direct properties are included; children (such as executions or transitions) are not considered. - \`\`1\`\`: Direct properties and children references are included. - \`\`2\`\`: Direct properties and children properties are included. - \`\`3\`\`: Direct properties and children properties and children's children are included. - etc. | \[optional]                            |
| **order\_by** | **String** | Use this parameter to specify by which the returned list should be sorted. Valid values are: \`\`createdDate\`\` and \`\`lastModifiedDate\`\`.                                                                                                                                                                                                                                                                                                 | \[optional]\[default to 'createdDate'] |

### Return type

[**ServerCollection**](https://docs.ionos.com/sections-test/ruby-sdk/vm-autoscaling-ruby-sdk/models/servercollection)

### Authorization

basicAuth, tokenAuth

### HTTP request headers

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