Packer Templates

Packer Templates endpoints

This document contains the endpoints for the Packer Templates category.

Gets all the packer templates:

This endpoint returns all the packer templates

Request examples
/v1/templates/packer Authorized
curl --location 'http://localhost/api/v1/templates/packer' 
--header 'Authorization ••••••'

var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/api/v1/templates/packer");
request.Headers.Add("Authorization", "••••••");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var responseString = await response.Content.ReadAsStringAsync();

package main

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

func main() {
  url := "http://localhost/api/v1/templates/packer"
  method := "get"
  client := &http.Client{}
  req, err := http.NewRequest(method, url, payload)
  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")

  req.Header.Add("Authorization", "••••••")
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()
  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

Responses
[
  {
    "addons": "[]string",
    "created_at": "string",
    "defaults": "map[string]string",
    "description": "string",
    "id": "string",
    "internal": "bool",
    "name": "string",
    "packer_folder": "string",
    "required_claims": "[]string",
    "required_roles": "[]string",
    "specs": "map[string]string",
    "updated_at": "string",
    "variables": "map[string]string"
  }
]
{
  "code": "int",
  "message": "string",
  "stack": [
    {
      "code": "int",
      "description": "string",
      "error": "string",
      "path": "string"
    }
  ]
}
{
  "error": "OAuthErrorType",
  "error_description": "string",
  "error_uri": "string"
}
Gets a packer template:

This endpoint returns a packer template

Parameters
id Packer Template ID required path
Request examples
/v1/templates/packer/{id} Authorized
curl --location 'http://localhost/api/v1/templates/packer/{id}' 
--header 'Authorization ••••••'

var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/api/v1/templates/packer/{id}");
request.Headers.Add("Authorization", "••••••");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var responseString = await response.Content.ReadAsStringAsync();

package main

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

func main() {
  url := "http://localhost/api/v1/templates/packer/{id}"
  method := "get"
  client := &http.Client{}
  req, err := http.NewRequest(method, url, payload)
  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")

  req.Header.Add("Authorization", "••••••")
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()
  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

Responses
[
  {
    "addons": "[]string",
    "created_at": "string",
    "defaults": "map[string]string",
    "description": "string",
    "id": "string",
    "internal": "bool",
    "name": "string",
    "packer_folder": "string",
    "required_claims": "[]string",
    "required_roles": "[]string",
    "specs": "map[string]string",
    "updated_at": "string",
    "variables": "map[string]string"
  }
]
{
  "code": "int",
  "message": "string",
  "stack": [
    {
      "code": "int",
      "description": "string",
      "error": "string",
      "path": "string"
    }
  ]
}
{
  "error": "OAuthErrorType",
  "error_description": "string",
  "error_uri": "string"
}
Creates a packer template:

This endpoint creates a packer template

Parameters
createPackerTemplateRequest Create Packer Template Request body
{
  "addons": "[]string",
  "created_at": "string",
  "defaults": "map[string]string",
  "description": "string",
  "id": "string",
  "internal": "bool",
  "name": "string",
  "packer_folder": "string",
  "required_claims": "[]string",
  "required_roles": "[]string",
  "specs": "map[string]string",
  "updated_at": "string",
  "variables": "map[string]string"
}
Request examples
/v1/templates/packer Authorized
curl --location 'http://localhost/api/v1/templates/packer ' 
--header 'Authorization ••••••'
--header 'Content-Type: application/json' 
--data '{
  "addons": "[]string",
  "created_at": "string",
  "defaults": "map[string]string",
  "description": "string",
  "id": "string",
  "internal": "bool",
  "name": "string",
  "packer_folder": "string",
  "required_claims": "[]string",
  "required_roles": "[]string",
  "specs": "map[string]string",
  "updated_at": "string",
  "variables": "map[string]string"
}'

var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/api/v1/templates/packer ");
request.Headers.Add("Authorization", "••••••");
request.Headers.Add("Content-Type", "application/json");
request.Content = new StringContent("{
  "addons": "[]string",
  "created_at": "string",
  "defaults": "map[string]string",
  "description": "string",
  "id": "string",
  "internal": "bool",
  "name": "string",
  "packer_folder": "string",
  "required_claims": "[]string",
  "required_roles": "[]string",
  "specs": "map[string]string",
  "updated_at": "string",
  "variables": "map[string]string"
}");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var responseString = await response.Content.ReadAsStringAsync();

package main

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

func main() {
  url := "http://localhost/api/v1/templates/packer "
  method := "post"
  payload := strings.NewReader(`{
  "addons": "[]string",
  "created_at": "string",
  "defaults": "map[string]string",
  "description": "string",
  "id": "string",
  "internal": "bool",
  "name": "string",
  "packer_folder": "string",
  "required_claims": "[]string",
  "required_roles": "[]string",
  "specs": "map[string]string",
  "updated_at": "string",
  "variables": "map[string]string"
}`)
  client := &http.Client{}
  req, err := http.NewRequest(method, url, payload)
  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")

  req.Header.Add("Authorization", "••••••")
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()
  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

Responses
[
  {
    "addons": "[]string",
    "created_at": "string",
    "defaults": "map[string]string",
    "description": "string",
    "id": "string",
    "internal": "bool",
    "name": "string",
    "packer_folder": "string",
    "required_claims": "[]string",
    "required_roles": "[]string",
    "specs": "map[string]string",
    "updated_at": "string",
    "variables": "map[string]string"
  }
]
{
  "code": "int",
  "message": "string",
  "stack": [
    {
      "code": "int",
      "description": "string",
      "error": "string",
      "path": "string"
    }
  ]
}
{
  "error": "OAuthErrorType",
  "error_description": "string",
  "error_uri": "string"
}
Updates a packer template:

This endpoint updates a packer template

Parameters
createPackerTemplateRequest Update Packer Template Request body
{
  "addons": "[]string",
  "created_at": "string",
  "defaults": "map[string]string",
  "description": "string",
  "id": "string",
  "internal": "bool",
  "name": "string",
  "packer_folder": "string",
  "required_claims": "[]string",
  "required_roles": "[]string",
  "specs": "map[string]string",
  "updated_at": "string",
  "variables": "map[string]string"
}
id Packer Template ID required path
Request examples
/v1/templates/packer/{id} Authorized
curl --location 'http://localhost/api/v1/templates/packer/{id} ' 
--header 'Authorization ••••••'
--header 'Content-Type: application/json' 
--data '{
  "addons": "[]string",
  "created_at": "string",
  "defaults": "map[string]string",
  "description": "string",
  "id": "string",
  "internal": "bool",
  "name": "string",
  "packer_folder": "string",
  "required_claims": "[]string",
  "required_roles": "[]string",
  "specs": "map[string]string",
  "updated_at": "string",
  "variables": "map[string]string"
}'

var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Put, "http://localhost/api/v1/templates/packer/{id} ");
request.Headers.Add("Authorization", "••••••");
request.Headers.Add("Content-Type", "application/json");
request.Content = new StringContent("{
  "addons": "[]string",
  "created_at": "string",
  "defaults": "map[string]string",
  "description": "string",
  "id": "string",
  "internal": "bool",
  "name": "string",
  "packer_folder": "string",
  "required_claims": "[]string",
  "required_roles": "[]string",
  "specs": "map[string]string",
  "updated_at": "string",
  "variables": "map[string]string"
}");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var responseString = await response.Content.ReadAsStringAsync();

package main

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

func main() {
  url := "http://localhost/api/v1/templates/packer/{id} "
  method := "PUT"
  payload := strings.NewReader(`{
  "addons": "[]string",
  "created_at": "string",
  "defaults": "map[string]string",
  "description": "string",
  "id": "string",
  "internal": "bool",
  "name": "string",
  "packer_folder": "string",
  "required_claims": "[]string",
  "required_roles": "[]string",
  "specs": "map[string]string",
  "updated_at": "string",
  "variables": "map[string]string"
}`)
  client := &http.Client{}
  req, err := http.NewRequest(method, url, payload)
  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")

  req.Header.Add("Authorization", "••••••")
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()
  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

Responses
[
  {
    "addons": "[]string",
    "created_at": "string",
    "defaults": "map[string]string",
    "description": "string",
    "id": "string",
    "internal": "bool",
    "name": "string",
    "packer_folder": "string",
    "required_claims": "[]string",
    "required_roles": "[]string",
    "specs": "map[string]string",
    "updated_at": "string",
    "variables": "map[string]string"
  }
]
{
  "code": "int",
  "message": "string",
  "stack": [
    {
      "code": "int",
      "description": "string",
      "error": "string",
      "path": "string"
    }
  ]
}
{
  "error": "OAuthErrorType",
  "error_description": "string",
  "error_uri": "string"
}
Deletes a packer template:

This endpoint deletes a packer template

Parameters
id Packer Template ID required path
Request examples
/v1/templates/packer/{id} Authorized
curl --location 'http://localhost/api/v1/templates/packer/{id} ' 
--header 'Authorization ••••••'

var client = new HttpClient();

var request = new HttpRequestMessage(HttpMethod.Delete, "http://localhost/api/v1/templates/packer/{id} ");
request.Headers.Add("Authorization", "••••••");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var responseString = await response.Content.ReadAsStringAsync();

package main

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

func main() {
  url := "http://localhost/api/v1/templates/packer/{id} "
  method := "DELETE"
  client := &http.Client{}
  req, err := http.NewRequest(method, url, payload)
  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")

  req.Header.Add("Authorization", "••••••")
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()
  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

Responses
{
  "code": "int",
  "message": "string",
  "stack": [
    {
      "code": "int",
      "description": "string",
      "error": "string",
      "path": "string"
    }
  ]
}
{
  "error": "OAuthErrorType",
  "error_description": "string",
  "error_uri": "string"
}