Create Distributions
- POST
- /workspaces
- /:workspace
- /distributions
Create a new distribution
Examples
Create a new distribution in a workspaceCreate a new distribution in a projectCreate a new distribution in an environment
Example: Create a new distribution in a workspace
curl -X POST "https://api.buddy.works/workspaces/:workspace/distributions" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "My Distribution",
"scope": "WORKSPACE",
"identifier": "my-distribution",
"note": "Notes about this resource",
"agent_note": "my_custom_field: note for agent"
}'Example: Create a new distribution in a project
curl -X POST "https://api.buddy.works/workspaces/:workspace/distributions" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "My Distribution",
"scope": "PROJECT",
"identifier": "my-distribution",
"project_name": "my-project",
"note": "Notes about this resource",
"agent_note": "my_custom_field: note for agent"
}'Example: Create a new distribution in an environment
curl -X POST "https://api.buddy.works/workspaces/:workspace/distributions" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "My Distribution",
"scope": "ENVIRONMENT",
"identifier": "my-distribution",
"environment_id": "3a4KbBQl"
}'EXAMPLE RESPONSE
{
"url": "https://api.buddy.works/workspaces/my-workspace/distributions/rm1P93jG",
"html_url": "https://app.buddy.works/my-workspace/-/routing/rm1P93jG/routes",
"id": "rm1P93jG",
"identifier": "test",
"name": "test",
"disabled": false,
"scope": "WORKSPACE",
"routes": [
{
"url": "https://api.buddy.works/workspaces/my-workspace/distributions/rm1P93jG/routes/1ObP9zw8",
"html_url": "https://app.buddy.works/my-workspace/-/routing/rm1P93jG/route/1ObP9zw8",
"id": "1ObP9zw8",
"type": "DIRECT_PROXY",
"subdomain": "testing3",
"domain": "buddy.works",
"path": "",
"targets": {
"Default": {
"type": "EXTERNAL",
"external_url": "kordos.com"
}
}
},
{
"url": "https://api.buddy.works/workspaces/my-workspace/distributions/rm1P93jG/routes/VXb2ZOb3",
"html_url": "https://app.buddy.works/my-workspace/-/routing/rm1P93jG/route/VXb2ZOb3",
"id": "VXb2ZOb3",
"type": "DIRECT_PROXY",
"subdomain": "tunnel",
"domain": "buddy.works",
"path": "",
"targets": {
"Default": {
"type": "TUNNEL",
"tunnel": {
"agent_id": "j9wYx1vb",
"tunnel_id": "50edvo3Y"
}
}
}
},
{
"url": "https://api.buddy.works/workspaces/my-workspace/distributions/rm1P93jG/routes/JqbOmp06",
"html_url": "https://app.buddy.works/my-workspace/-/routing/rm1P93jG/route/JqbOmp06",
"id": "JqbOmp06",
"type": "DIRECT_PROXY",
"subdomain": "asdf",
"domain": "buddy.works",
"path": "asd",
"targets": {
"PL": {
"type": "EXTERNAL",
"external_url": "testpl.com"
},
"Europe": {
"type": "EXTERNAL",
"external_url": "testeu.com"
},
"Default": {
"type": "EXTERNAL",
"external_url": "test.com"
}
}
}
],
"permissions": {
"others": "READ_ONLY",
"users": [
{
"id": 1,
"access_level": "MANAGE"
}
]
},
"note": "Notes about this resource",
"agent_note": "my_custom_field: note for agent"
}STATUS
201 Created