# Assign

## Assign

<mark style="color:green;">`POST`</mark> `https://api.suble.io/projects/:projectId/floating_ips/:id/assign`

Assign floating ip to virtual machine

#### Path Parameters

| Name      | Type   | Description               |
| --------- | ------ | ------------------------- |
| projectId | string | Unique id for the project |
| id        | string | Floating IP Id            |

#### Headers

| Name          | Type   | Description               |
| ------------- | ------ | ------------------------- |
| Authorization | string | User token or project key |

#### Request Body

| Name | Type   | Description           |
| ---- | ------ | --------------------- |
| vm   | string | Id of virtual machine |

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

```
{
    "status": "success"
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "error": String
}
```

{% endtab %}
{% endtabs %}

## Detach

<mark style="color:red;">`DELETE`</mark> `https://api.suble.io/projects/:projectId/floating_ips/:id/assign?vm=:vm`

Detach floating ip from virtual machine

#### Path Parameters

| Name                                        | Type   | Description               |
| ------------------------------------------- | ------ | ------------------------- |
| projectId<mark style="color:red;">\*</mark> | string | Unique id for the project |
| id<mark style="color:red;">\*</mark>        | string | Floating IP Id            |

#### Query Parameters

| Name                                 | Type     | Description |
| ------------------------------------ | -------- | ----------- |
| vm<mark style="color:red;">\*</mark> | ObjectID | VM ID       |

#### Headers

| Name                                            | Type   | Description               |
| ----------------------------------------------- | ------ | ------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | User token or project key |

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

```
{
    "status": "success"
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "error": String
}
```

{% endtab %}
{% endtabs %}
