Community

How to create a NAMED ipblock via RESTFUL Api?

Hello,

I think the documentation is outdated. I want to create an IP-Block with a specific name via RESTFUL Api (https://devops.profitbricks.com/api/rest/#create-ip-block). The documentation does not tell about any request parameters. I've to create a json object with at least properties->location set.

The api tells me there would be a 200 status code returned, but it is 202.

Can someone please update the docu or tell me how to do this?

 
  • **bold**
  • _italics_
  • `code`
  • ```code block```
  • # Heading 1
  • ## Heading 2
  • > Quote
 

Hello,

The 'name' option is available in version 2 of the REST API and we should have documentation available for that shortly. The REST API endpoint to use would be: https://api.profitbricks.com/rest/v2/ipblocks

The request body would contain:

{
        "properties": {
            "location": "us/las",
            "size": 5,
            "name": "IP Block Five"
        }
}

Also - the previously referenced "location" is no longer valid. It should be "us/las" or one of the other valid locations.

Sadly, the API doesn't support creating a named IP Block at this time. I do believe it will be part of a near-term release. The only parameters that are supported are:

  • location, string
  • size, int

Both are required.

You are correct. The documentation needs to be updated. You would pass a JSON request like this to '/ipblocks':

{
        "properties": {
            "location": "us/lasdev",
            "size": 5
        }
}

A 202 will be returned if successful.

  • Please add the name option!

Why is the answer of baldwin the accepted one? I never did this. This question should remain open, until the name option is added.

Glad to hear this. Helps us to organize our ip-blocks better.