> For the complete documentation index, see [llms.txt](https://resource.deepstone.cloud/deepstone-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://resource.deepstone.cloud/deepstone-api/endpoint-list/resource-pool.md).

# Resource Pool

The Resource Pool is the logical container of all the Virtual Machines owned by the Customer.

Each Resource Pool has a set of resources reserved for it within which the user, via API or portal, can create all the desired workloads.

Below is the documentation to support the management of Resource Pools and the related Virtual Machines.

{% hint style="warning" %}

### Beta Status of Endpoint APIs

Please note that the group of endpoint APIs discussed in this document are currently in beta. This means that they are in a trial phase and are not yet finalized. While in beta, these APIs may be subject to change and could have limited support. We encourage users to test these beta APIs and provide feedback to help us improve their functionality before a full release. Keep in mind that during the beta period, the performance and reliability standards may not reflect those of the final version.
{% endhint %}

***

## List all available Resource Pool

<mark style="color:blue;">`GET`</mark> `https://api.deepstone.cloud/v1/resource-pool/`

{% tabs %}
{% tab title="200: OK List all Resource Pool" %}

{% endtab %}

{% tab title="401: Unauthorized Not authorized" %}

{% endtab %}
{% endtabs %}

## Get single resource pool data with VM list

<mark style="color:blue;">`GET`</mark> `https://api.deepstone.cloud/v1/resource-pool/[resource-pool-id]`

{% tabs %}
{% tab title="200: OK Contain Resource Pool info and a list of all VMs inside" %}

{% endtab %}

{% tab title="401: Unauthorized Not authorized" %}

{% endtab %}
{% endtabs %}

## Return list of available ISO and Guest OS

<mark style="color:blue;">`GET`</mark> `https://api.deepstone.cloud/v1/resource-pool/iso-inventory`

{% tabs %}
{% tab title="200: OK Contain VM  Status" %}

{% endtab %}

{% tab title="401: Unauthorized Not authorized" %}

{% endtab %}
{% endtabs %}

## Create New VM

<mark style="color:green;">`POST`</mark> `https://api.deepstone.cloud/v1/resource-pool/[resource-pool-id]`

The process is not immediate and may continue after the endpoint responds

#### Request Body

| Name                                         | Type   | Description                         |
| -------------------------------------------- | ------ | ----------------------------------- |
| name<mark style="color:red;">\*</mark>       | String | Name of Virtual Machine             |
| iso\_id<mark style="color:red;">\*</mark>    | Int    | ID of selected ISO                  |
| cpu<mark style="color:red;">\*</mark>        | int    | Numbers of CPU                      |
| ram<mark style="color:red;">\*</mark>        | int    | Size of memory, in MiB              |
| datacenter<mark style="color:red;">\*</mark> | String | Datacenter for VM. "Deca1", "Deca2" |
| storage<mark style="color:red;">\*</mark>    | int    | Size of storage, in GiB             |
|                                              | String |                                     |

{% tabs %}
{% tab title="200: OK Vm power is resetted, VM is rebboting." %}

{% endtab %}

{% tab title="401: Unauthorized Not authorized" %}

{% endtab %}

{% tab title="400: Bad Request Bad Request Format" %}

{% endtab %}
{% endtabs %}

## Get single VM data and status

<mark style="color:blue;">`GET`</mark> `https://api.deepstone.cloud/v1/vm/[vm-code]`

{% tabs %}
{% tab title="200: OK Contain VM Details and Status" %}

{% endtab %}

{% tab title="401: Unauthorized Not authorized" %}

{% endtab %}
{% endtabs %}

## Get single VM  status

<mark style="color:blue;">`GET`</mark> `https://api.deepstone.cloud/v1/vm/[vm-code]/status`

{% tabs %}
{% tab title="200: OK Contain VM  Status" %}

{% endtab %}

{% tab title="401: Unauthorized Not authorized" %}

{% endtab %}
{% endtabs %}

## Edit VM

<mark style="color:green;">`POST`</mark> `https://api.deepstone.cloud/v1/vm/[vm-code]`

This method work only if VM is "POWER-OFF"

#### Request Body

| Name                                      | Type   | Description             |
| ----------------------------------------- | ------ | ----------------------- |
| cpu<mark style="color:red;">\*</mark>     | int    | Numbers of CPU          |
| ram<mark style="color:red;">\*</mark>     | int    | Size of memory, in MiB  |
| storage<mark style="color:red;">\*</mark> | int    | Size of storage, in GiB |
|                                           | String |                         |

{% tabs %}
{% tab title="200: OK Vm power is resetted, VM is rebboting." %}

{% endtab %}

{% tab title="401: Unauthorized Not authorized" %}

{% endtab %}

{% tab title="400: Bad Request Bad Request Format" %}

{% endtab %}
{% endtabs %}

## Turn On specific VM

<mark style="color:green;">`POST`</mark> `https://api.deepstone.cloud/v1/vm/[vm-code]/power-on`

The process is not immediate and may continue after the endpoint responds

{% tabs %}
{% tab title="200: OK Vm is turning on." %}

{% endtab %}

{% tab title="401: Unauthorized Not authorized" %}

{% endtab %}

{% tab title="400: Bad Request Bad Request Format" %}

{% endtab %}
{% endtabs %}

## Turn Off specific VM

<mark style="color:green;">`POST`</mark> `https://api.deepstone.cloud/v1/vm/[vm-code]/power-off`

The process is not immediate and may continue after the endpoint responds

{% tabs %}
{% tab title="200: OK Vm is turning off." %}

{% endtab %}

{% tab title="400: Bad Request Bad Request Format" %}

{% endtab %}

{% tab title="401: Unauthorized Not authorized" %}

{% endtab %}
{% endtabs %}

## Resetting power to specific VM

<mark style="color:green;">`POST`</mark> `https://api.deepstone.cloud/v1/vm/[vm-code]/power-reset`

The process is not immediate and may continue after the endpoint responds

{% tabs %}
{% tab title="200: OK Vm power is resetted, VM is rebboting." %}

{% endtab %}

{% tab title="401: Unauthorized Not authorized" %}

{% endtab %}

{% tab title="400: Bad Request Bad Request Format" %}

{% endtab %}
{% endtabs %}

## Return all rules for specific VM

<mark style="color:blue;">`GET`</mark> `https://api.deepstone.cloud/v1/vm/[vm-code]/firewall-rule`

The process is not immediate and may continue after the endpoint responds

{% tabs %}
{% tab title="200: OK Vm power is resetted, VM is rebboting." %}

{% endtab %}

{% tab title="401: Unauthorized Not authorized" %}

{% endtab %}
{% endtabs %}

## Add a rule to Firewall table

<mark style="color:green;">`POST`</mark> `https://api.deepstone.cloud/v1/vm/[vm-code]/firewall-rule`

#### Request Body

| Name                                   | Type   | Description                              |
| -------------------------------------- | ------ | ---------------------------------------- |
| port<mark style="color:red;">\*</mark> | Int    | TCP/UDP Port Number                      |
| type<mark style="color:red;">\*</mark> | String | "TCP" / "UDP"                            |
| cidr                                   | String | JSON Array of Subnets. 0.0.0.0/0 for all |

{% tabs %}
{% tab title="200: OK Vm power is resetted, VM is rebboting." %}

{% endtab %}

{% tab title="401: Unauthorized Not authorized" %}

{% endtab %}
{% endtabs %}

## Delete single firewall rule

<mark style="color:red;">`DELETE`</mark> `https://api.deepstone.cloud/v1/vm/[vm-code]/firewall-rule/[rule-id]`

{% tabs %}
{% tab title="200: OK Vm power is resetted, VM is rebboting." %}

{% endtab %}

{% tab title="401: Unauthorized Not authorized" %}

{% endtab %}
{% endtabs %}

## Delete single vm

<mark style="color:red;">`DELETE`</mark> `https://api.deepstone.cloud/v1/vm/[vm-code]`

Operation permitted with machine off only

{% tabs %}
{% tab title="200: OK Vm power is resetted, VM is rebboting." %}

{% endtab %}

{% tab title="401: Unauthorized Not authorized" %}

{% endtab %}
{% endtabs %}
