How to Create a Domain

First Mile Locations

The first-mile location is the nuu:bit PoP that has the lowest latency to the content origin. To create a domain, it is necessary to select the correct first-mile location. This is typically the same city as the origin data center. If the city of the origin data center is not listed, select the next nearest city.

To show all of the first mile locations, nuu:bit provides the following API call:

https://api.nuubit.net/v1/locations/firstmile

cURL example:

curl  -u '[email protected]:password' https://api.nuubit.net/v1/locations/firstmile

Response body:

[
  {
    "locationName": "San Jose, CA",
    "id": "5588868cbde7a0d00338ce8e"
  },
  {
    "locationName": "New York, NY",
    "id": "55a56fa6476c10c329a90741"
  }
]

Create a Domain

To create a domain, use the following POST to the api.nuubit.net endpoint.

  https://api.nuubit.net/v1/domains/

cURL example:

curl  -u '[email protected]:password' -X POST -H 'Content-Type: application/json'  -T Domain.json https://api.nuubit.net/v1/domains

Using the response from the first mile request, select the nearest first mile location to the origin. The example JSON (Domain.json) would be the following:

{
  "name": "www.example.com",
  "origin_server": "origin.example.com",
  "companyId": "5588869fbde7a0d00338ce8f",
  "origin_server_location": "San Jose, CA",
  "origin_host_header": "www.example.com",
  "tolerance": "4000"
}

Body response:

{
  "statusCode": 200,
  "message": "Successfully created the domain",
  "object_id": "55c0222fe9032a2d741b9f38"
}

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk