Skip to content

Latest commit

 

History

History
105 lines (81 loc) · 3.4 KB

File metadata and controls

105 lines (81 loc) · 3.4 KB

Floating IPs

Floating IPs are public IP addresses that a user can acquire and use in an environment.

List floating IPs

curl -H "MC-Api-Key: your_api_key" \
    "https://cloudmc_endpoint/api/v2/services/compute-os/devel/floatingips"

The above command returns a JSON structured like this:

{
    "data": [
        {
            "id": "287a3963-983b-4602-9dea-4dff89e9dc10",
            "floatingIpAddress": "10.182.56.27",
            "fixedIpAddress": "10.0.0.8",
            "externalNetworkId": "963b6966-d9d7-48a8-8141-f414a809dbf4"
        }
    ],
    "metadata": {
        "recordCount": 1
    }
}

GET /services/:service_code/:environment_name/floatingips

Retrieve a list of all floating IPs in an environment.

Attributes  
id
UUID
The floating IP's id.
floatingIpAddress
string
The floating IP's public IP address.
fixedIpAddress
string
The fixed IP to which the floating IP is associated. This may be empty if the floating IP is not associated with an instance.
externalNetworkId
UUID
The id of the external network to which the floating IP belongs.

Retrieve a floating IP

curl -H "MC-Api-Key: your_api_key" \
    "https://cloudmc_endpoint/api/v2/services/compute-os/devel/floatingips/287a3963-983b-4602-9dea-4dff89e9dc10"

The above command returns a JSON structured like this:

{
    "data": {
         "id": "287a3963-983b-4602-9dea-4dff89e9dc10",
         "floatingIpAddress": "10.182.56.27",
         "fixedIpAddress": "10.0.0.8",
         "externalNetworkId": "963b6966-d9d7-48a8-8141-f414a809dbf4"
    }
}

GET /services/:service_code/:environment_name/floatingips/:id

Retrieve information about a floating IP.

Attributes  
id
UUID
The floating IP's id.
floatingIpAddress
string
The floating IP's public IP address.
fixedIpAddress
string
The fixed IP to which the floating IP is associated. This may be empty if the floating IP is not associated with an instance.
externalNetworkId
UUID
The id of the external network to which the floating IP belongs.

Acquire a floating IP

curl -X POST \
    -H "MC-Api-Key: your_api_key" \ 
    -d "request_body" \
    "https://cloudmc_endpoint/api/v2/services/compute-os/devel/floatingips"

Request body example:

{
    "externalNetworkId": "networkId",
}

POST /services/:service_code/:environment_name/floatingips

Acquire a floating IP in an environment.

Optional  
externalNetworkId
string
The external network id to associate the new floating ip. If there is more than one network, it will be required to specify it.

Release a floating IP

curl -X DELETE \
    -H "MC-Api-Key: your_api_key"
    "https://cloudmc_endpoint/api/v2/services/compute-os/devel/floatingips/287a3963-983b-4602-9dea-4dff89e9dc10"

DELETE /services/:service_code/:environment_name/floatingips/:id

Release a floating IP.