curl --request GET \
--url {schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks \
--header 'Authorization: Bearer <token>'import requests
url = "{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks', 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 => "{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks",
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 := "{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks"
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("{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"resources": {
"base_memory": 123,
"memory_ratio": 123
},
"authorizations": [
{
"type": "env",
"action": "<string>",
"resource": "<string>"
}
],
"relationships": {},
"additional_hosts": {},
"mounts": {},
"timezone": "<string>",
"variables": {},
"container_profile": "<string>",
"type": "<string>",
"source": {
"root": "<string>"
},
"hooks": {
"build": "<string>",
"deploy": "<string>"
},
"dependencies": {},
"runtime": {},
"run": {
"command": "<string>",
"timeout": 123
},
"name": "<string>"
}
]Get projects environments tasks
curl --request GET \
--url {schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks \
--header 'Authorization: Bearer <token>'import requests
url = "{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks', 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 => "{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks",
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 := "{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks"
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("{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"resources": {
"base_memory": 123,
"memory_ratio": 123
},
"authorizations": [
{
"type": "env",
"action": "<string>",
"resource": "<string>"
}
],
"relationships": {},
"additional_hosts": {},
"mounts": {},
"timezone": "<string>",
"variables": {},
"container_profile": "<string>",
"type": "<string>",
"source": {
"root": "<string>"
},
"hooks": {
"build": "<string>",
"deploy": "<string>"
},
"dependencies": {},
"runtime": {},
"run": {
"command": "<string>",
"timeout": 123
},
"name": "<string>"
}
]Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
The identifier of Task
Resources configuration (base memory and memory ratio)
Show child attributes
Show child attributes
Authorizations available to this container
Show child attributes
Show child attributes
The relationships of the container to defined services
Show child attributes
Show child attributes
A mapping of hostname to ip address to be added to the container's hosts file
Show child attributes
Show child attributes
Filesystem mounts of this container. If not specified the container will have no writeable disk space
Show child attributes
Show child attributes
The timezone of the task. Defaults to the project's timezone if not specified
Variables provide environment-sensitive information to control how this container behaves. To set a Unix environment variable, specify a key of env:, and then each sub-item of that is a key/value pair that will be injected into the environment
Show child attributes
Show child attributes
Selected container profile for this container
The runtime type and version for the task (e.g., python:3.8)
Configuration related to the source code of the task
Show child attributes
Show child attributes
Scripts executed at various points in the lifecycle of the task
Show child attributes
Show child attributes
External global dependencies of this task. They will be downloaded by the language's package manager
Show child attributes
Show child attributes
Runtime-specific configuration
Configuration for task execution
Show child attributes
Show child attributes
The unique name of the task
Was this page helpful?