Skip to main content
Infrastructure/Collects
POSTInfrastructureSince 1.0SynchronousAuth Required

UploadTemplate

Upload a new custom template to the marketplace.

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Request Inputs

Body Fields

  • nameStringRequired

    Human-readable name for the new template

    Example: My Custom Log Template

  • descriptionStringRequired

    Detailed description of what this template collects

    Example: Collects application logs from /var/log/myapp/

  • categoryStringRequired

    Category for organizing the template in the marketplace

    Example: application

  • configObjectRequired

    Configuration data as key-value pairs

    Example: (nested object)

  • variablesLinkedHashMapRequired

    Template variables for parameter substitution

    Example: (nested object)

Responses

200 OK

On success, this API returns the following response structure.

  • idString

    Unique identifier of the template

    Example: tmpl-nginx-001

  • nameString

    Human-readable name of the template

    Example: Nginx Access Log Collector

  • descriptionString

    Description of what this template collects and how it works

    Example: Collects Nginx access logs and parses common log format

  • categoryString

    Category grouping for the template (e.g. web, database, os)

    Example: web

  • authorString

    Author or organization that created this template

    Example: zstack

  • downloadsInteger

    Number of times this template has been downloaded

    Example: 120

  • ratingLong

    Average user rating of this template on a scale of 1 to 5

    Example: 4.5

  • configObject

    Configuration data as key-value pairs

    Example: (nested object)

  • variablesLinkedHashMap

    Template variables for parameter substitution

    Example: (nested object)

  • createDateString

    Create date

    Example: 2026-01-15T08:00:00Z

Endpoint

POST/api/v1/collects/templates

/api/v1/collects/templates

Operation ID

UploadTemplate

Permalink

Request Example

curl -X POST '{host}/api/v1/collects/templates' -H 'Authorization: Bearer {token}' -H 'Content-Type: application/json' -d '{"name":"My Custom Log Template","description":"Collects application logs from /var/log/myapp/","category":"application","config":"(nested object)","variables":"(nested object)"}'

Response Example

200
{
  "id": "tmpl-nginx-001",
  "name": "Nginx Access Log Collector",
  "description": "Collects Nginx access logs and parses common log format",
  "category": "web",
  "author": "zstack",
  "downloads": 120,
  "rating": 4.5,
  "config": null
}

Change History

This API has no change history records yet.

View all change history