# Virtual machine

The "Virtual machines" section allows the management of vm resources. You can view all the vms created by a particular team and delete resources if necessary.

## Delete virtual machine by ID

<mark style="color:red;">`DELETE`</mark> `{{BASE_URL}}/admin/api/virtual-machines/{id}`

Delete a specific virtual machine by unique id.

#### Path Parameters

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | String | Database ID |

#### Headers

| Name                                      | Type   | Description   |
| ----------------------------------------- | ------ | ------------- |
| Api-Key<mark style="color:red;">\*</mark> | String | Admin api key |

{% tabs %}
{% tab title="200: OK " %}

```json
{"message":"Virtual machine deleted","vmId":"6548d4f261cabb0308b984ee"}
```

{% endtab %}
{% endtabs %}

## Get virtual machines

<mark style="color:blue;">`GET`</mark> `{{BASE_URL}}/admin/api/teams/{id}/virtual-machines`

Get all virtual machines for a specific team.

#### Query Parameters

| Name                                    | Type   | Description |
| --------------------------------------- | ------ | ----------- |
| page<mark style="color:red;">\*</mark>  | String | 1           |
| limit<mark style="color:red;">\*</mark> | String | 10          |

#### Headers

| Name                                      | Type   | Description   |
| ----------------------------------------- | ------ | ------------- |
| Api-Key<mark style="color:red;">\*</mark> | String | Admin api key |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "docs": [
        {
            "_id": "6549ebb3fb723c0a85a5244a",
            "region": {
                "datacenter": {
                    "name": "berlin",
                    "displayName": "Berlin"
                },
                "physicalLocation": "Germany"
            },
            "image": {
                "version": {
                    "name": "20_04-lts",
                    "displayName": "20.04 LTS"
                },
                "distribution": "Ubuntu"
            },
            "attestationId": "6392ea3c-5650-4b0c-a1dc-0214780f3955",
            "access": null,
            "authMethod": 1,
            "status": 7,
            "isBlocked": false,
            "tags": [],
            "subscription": null,
            "name": "kraud-cloud-ubuntu-1vcpu-4gb-berlin-01",
            "provider": {
                "_id": "6548a383e2442d14b6bf968b",
                "type": "vm",
                "isDisabled": false,
                "cloudProvider": {
                    "_id": "6548a383e2442d14b6bf9685",
                    "name": "Kraud.Cloud",
                    "isDisabled": false
                }
            },
            "size": {
                "_id": "6548a383e2442d14b6bf9745",
                "provider": "6548a383e2442d14b6bf968b",
                "location": "berlin",
                "name": "Standart_berlin_1_4_50",
                "vCPUs": 1,
                "memoryGB": 4,
                "spaceGB": 50,
                "group": 0
            },
            "price": {
                "_id": "6548a383e2442d14b6bf970b",
                "provider": "6548a383e2442d14b6bf968b",
                "locationName": "berlin",
                "sizeName": "Standart_berlin_1_4_50",
                "imageName": "Ubuntu",
                "pricePerHour": 0.04,
                "pricePerMonth": 30,
                "currencyCode": "EUR",
                "createdAt": "2023-11-06T08:27:47.134Z",
                "updatedAt": "2023-11-06T08:27:47.134Z"
            },
            "owner": {
                "_id": "6548a41138406c14db33b606",
                "name": "John Doe",
                "email": "john.doe@mail.com"
            },
            "project": {
                "_id": "6548a41f38406c14db33b62c",
                "name": "first-project",
                "description": "Update your project information under Settings",
                "environment": "Development",
                "purpose": "Just trying out Enclaive",
                "isDefault": false,
                "icon": 1,
                "owner": "6548a41138406c14db33b606",
                "team": "6548a41f38406c14db33b61e",
                "createdAt": "2023-11-06T08:30:23.552Z",
                "updatedAt": "2023-11-07T08:52:28.154Z"
            },
            "team": {
                "_id": "6548a41f38406c14db33b61e",
                "name": "My Team",
                "email": "john.doe@mail.com",
                "members": [
                    {
                        "user": "6548a41138406c14db33b606",
                        "role": 0
                    }
                ],
                "createdAt": "2023-11-06T08:30:23.529Z",
                "updatedAt": "2023-11-06T12:56:06.337Z",
                "billingSettings": "6548e2660919dc0442dc2ec7"
            },
            "ipConfigurations": [],
            "createdAt": "2023-11-07T07:48:03.587Z",
            "updatedAt": "2023-11-07T08:59:30.230Z",
            "deletedAt": "2023-11-07T08:59:27.195Z",
            "id": "6549ebb3fb723c0a85a5244a"
        },
    ],
    "totalDocs": 1,
    "limit": 10,
    "totalPages": 1,
    "page": 1,
    "pagingCounter": 1,
    "hasPrevPage": false,
    "hasNextPage": false,
    "prevPage": null,
    "nextPage": null
}
```

{% endtab %}
{% endtabs %}


---

# 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.enclaive.cloud/enclaive-multi-cloud-platform/developers/api/admin-admin-api/accounts/team/virtual-machine.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.
