AppLocation
Operations
Every route this entity exposes. Each route links to its own reference on this page.
| Method | Route | SDK operation | Returns |
|---|---|---|---|
POST |
/api/v1/hosting/apps/{app_id}/locations |
create |
Hosting location enabled for an app |
GET |
/api/v1/hosting/apps/{app_id}/locations |
list |
Available hosting locations |
DELETE |
/api/v1/hosting/apps/{app_id}/locations/{id} |
remove |
Success |
Examples
One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.
Golang
Construct client as shown in the Golang setup, then call the operations:
app_locations, err := client.AppLocation(nil).List(map[string]any{"app_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(app_locations)
created, err := client.AppLocation(nil).Create(map[string]any{"app_id": "example", "location_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(created)
removed, err := client.AppLocation(nil).Remove(map[string]any{"app_id": "example", "id": "example_id"}, nil)
if err != nil {
panic(err)
}
fmt.Println(removed)
Lua
Construct client as shown in the Lua setup, then call the operations:
local app_locations, err = client:AppLocation():list({ app_id = "example" })
local created, err = client:AppLocation():create({ app_id = "example", location_id = "example" })
local removed, err = client:AppLocation():remove({ app_id = "example", id = "example_id" })
PHP
Construct client as shown in the PHP setup, then call the operations:
$app_locations = $client->AppLocation()->list(["app_id" => "example"]);
$created = $client->AppLocation()->create(["app_id" => "example", "location_id" => "example"]);
$client->AppLocation()->remove(["app_id" => "example", "id" => "example_id"]);
Python
Construct client as shown in the Python setup, then call the operations:
app_locations = client.AppLocation().list({"app_id": "example"})
created = client.AppLocation().create({ "app_id": "example", "location_id": "example" })
client.AppLocation().remove({"app_id": "example", "id": "example_id"})
Ruby
Construct client as shown in the Ruby setup, then call the operations:
app_locations = client.AppLocation.list({ "app_id" => "example" })
created = client.AppLocation.create({ "app_id" => "example", "location_id" => "example" })
client.AppLocation.remove({ "app_id" => "example", "id" => "example_id" })
TypeScript
Construct client as shown in the TypeScript setup, then call the operations:
const app_locations = await client.AppLocation().list({ app_id: "example" })
const created = await client.AppLocation().create({ app_id: "example", location_id: "example" })
await client.AppLocation().remove({ app_id: "example", id: "example_id" })
Fields
| Field | Type | Required | Description |
|---|---|---|---|
code |
string |
Yes | Code |
created_at |
string |
Yes | Created At |
id |
string |
Yes | Id |
location_id |
string |
Yes | Location Id |
name |
string |
Yes | Name |
nomad_datacenter |
string |
Yes | Nomad Datacenter |
updated_at |
string |
Yes | Updated At |
create
POST /api/v1/hosting/apps/{app_id}/locations
Operation ID: post_api_v1_hosting_apps_app_id_locations.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
app_id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
location_id |
string |
Yes |
Responses
200: Hosting location enabled for an app
application/json
| Property | Type | Required | Description |
|---|---|---|---|
location |
object |
Yes | |
location.code |
string |
Yes | |
location.created_at |
string (date-time) |
Yes | |
location.id |
string |
Yes | |
location.name |
string |
Yes | |
location.nomad_datacenter |
string |
Yes | |
location.updated_at |
string (date-time) |
Yes |
201: Hosting location enabled for an app
application/json
| Property | Type | Required | Description |
|---|---|---|---|
location |
object |
Yes | |
location.code |
string |
Yes | |
location.created_at |
string (date-time) |
Yes | |
location.id |
string |
Yes | |
location.name |
string |
Yes | |
location.nomad_datacenter |
string |
Yes | |
location.updated_at |
string (date-time) |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
list
GET /api/v1/hosting/apps/{app_id}/locations
Operation ID: api_v1_app_locations.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
app_id |
path |
string |
Yes |
Responses
200: Available hosting locations
application/json
| Property | Type | Required | Description |
|---|---|---|---|
locations |
array of object |
Yes | |
locations[].code |
string |
Yes | |
locations[].created_at |
string (date-time) |
Yes | |
locations[].id |
string |
Yes | |
locations[].name |
string |
Yes | |
locations[].nomad_datacenter |
string |
Yes | |
locations[].updated_at |
string (date-time) |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
remove
DELETE /api/v1/hosting/apps/{app_id}/locations/{id}
Operation ID: api_v1_app_location.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
app_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Responses
200: Success
application/json
The response is object.