POST
/
v1
/
packs
Install a pack (POST — create semantics)
curl --request POST \
  --url https://api.example.com/v1/packs \
  --header 'Content-Type: application/octet-stream' \
  --data '[
  1
]'
import requests

url = "https://api.example.com/v1/packs"

payload = [1]
headers = {"Content-Type": "application/octet-stream"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/octet-stream'},
body: JSON.stringify([1])
};

fetch('https://api.example.com/v1/packs', 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://api.example.com/v1/packs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/octet-stream"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.example.com/v1/packs"

payload := strings.NewReader("[\n 1\n]")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/octet-stream")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.example.com/v1/packs")
.header("Content-Type", "application/octet-stream")
.body("[\n 1\n]")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/packs")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/octet-stream'
request.body = "[\n 1\n]"

response = http.request(request)
puts response.read_body
{
  "pack": {
    "default_rev": "<string>",
    "installed_at": "<string>",
    "instances": "<string>",
    "name": "<string>",
    "revs": 1,
    "services": [
      "<string>"
    ],
    "verbs": [
      "<string>"
    ],
    "base": "<string>",
    "description": "<string>"
  },
  "rev": "<string>",
  "unchanged": true,
  "base_build": {
    "id": "<string>",
    "status": "<string>",
    "version": "<string>"
  }
}

Query Parameters

name
string
required

Pack name (required)

source
string

Install source label

Body

application/octet-stream

gzip-compressed tar of the pack directory

Required range: x >= 0

Response

Pack installed

pack
object
required

One row in the pack list — summarizes the default rev.

rev
string
required
unchanged
boolean
required
base_build
null | object

Compact start acknowledgement (also embedded in PackInstallResponse).