Get an environment
curl --request GET \
--url https://envlink-api.projectinwork.com/v1/environments/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://envlink-api.projectinwork.com/v1/environments/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://envlink-api.projectinwork.com/v1/environments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://envlink-api.projectinwork.com/v1/environments/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://envlink-api.projectinwork.com/v1/environments/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://envlink-api.projectinwork.com/v1/environments/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://envlink-api.projectinwork.com/v1/environments/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "env_3iynbifi4k6xgfhn",
"name": "linux-build-3f2a",
"template": "linux-build",
"state": "pending",
"node": "<string>",
"sandbox": "<string>",
"pool": "linux-arm64",
"labels": {},
"project": "github.com/acme/app",
"readyMs": 123,
"error": "<string>",
"createdBy": "<string>",
"created": "2023-11-07T05:31:56Z",
"ready": "2023-11-07T05:31:56Z",
"stopped": "2023-11-07T05:31:56Z",
"expires": "2023-11-07T05:31:56Z",
"idleUntil": "2023-11-07T05:31:56Z",
"idle": "1h0m0s",
"hard": "6h0m0s",
"exports": [
{
"service": "postgres",
"listen": "127.0.0.1:5432",
"target": "127.0.0.1:5432"
}
],
"shares": [
{
"name": "src",
"direction": "in",
"envPath": "/work",
"localPath": ".",
"files": [
"<string>"
]
}
],
"snapshot": "<string>",
"restored": {
"key": "<string>",
"root": "<string>",
"files": 123,
"created": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"code": "<string>"
}Environments
Get an environment
By ID or by name.
GET
/
v1
/
environments
/
{id}
Get an environment
curl --request GET \
--url https://envlink-api.projectinwork.com/v1/environments/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://envlink-api.projectinwork.com/v1/environments/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://envlink-api.projectinwork.com/v1/environments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://envlink-api.projectinwork.com/v1/environments/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://envlink-api.projectinwork.com/v1/environments/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://envlink-api.projectinwork.com/v1/environments/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://envlink-api.projectinwork.com/v1/environments/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "env_3iynbifi4k6xgfhn",
"name": "linux-build-3f2a",
"template": "linux-build",
"state": "pending",
"node": "<string>",
"sandbox": "<string>",
"pool": "linux-arm64",
"labels": {},
"project": "github.com/acme/app",
"readyMs": 123,
"error": "<string>",
"createdBy": "<string>",
"created": "2023-11-07T05:31:56Z",
"ready": "2023-11-07T05:31:56Z",
"stopped": "2023-11-07T05:31:56Z",
"expires": "2023-11-07T05:31:56Z",
"idleUntil": "2023-11-07T05:31:56Z",
"idle": "1h0m0s",
"hard": "6h0m0s",
"exports": [
{
"service": "postgres",
"listen": "127.0.0.1:5432",
"target": "127.0.0.1:5432"
}
],
"shares": [
{
"name": "src",
"direction": "in",
"envPath": "/work",
"localPath": ".",
"files": [
"<string>"
]
}
],
"snapshot": "<string>",
"restored": {
"key": "<string>",
"root": "<string>",
"files": 123,
"created": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"code": "<string>"
}Authorizations
A CLI token or an organization API key.
Path Parameters
Its ID or name.
Response
OK
Example:
"env_3iynbifi4k6xgfhn"
Example:
"linux-build-3f2a"
Example:
"linux-build"
Available options:
pending, starting, ready, stopping, stopped, failed The node it runs on.
The sandbox it's wired to.
Example:
"linux-arm64"
Show child attributes
Show child attributes
Whose key seals its files.
Example:
"github.com/acme/app"
From request to ready.
Example:
"1h0m0s"
Example:
"6h0m0s"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The key its files are saved under when it ends.
Show child attributes
Show child attributes