fbpx
POSThttps://api.spotinst.io/functions/pattern?accountId={spotinst-account-id}

Create a pattern.

Parameter Type Description
accountId String

The account ID.

Example: act-12345
Request

Headers
{
  "Content-Type": "application/json",
  "Authorization": "Bearer ${TOKEN}"
}
Body
Copied!
Downloaded!
{
	"pattern": {
		"environmentId": "env-123",
		"method": "GET",
		"pattern": "/foo/bar/{}/baz/*",
		"functionId": "fx-123",
		"functionVersion": 2
	}
}
  • pattern.environmentId * String
    The environment ID
    Example: env-12345
  • pattern.method * String
    Valid methods the pattern accepts. Can be:
    GET
    PUT
    POST
    DELETE
    OPTIONS
    PATCH
    ALL
    Example: GET
  • pattern.pattern * String
    The path parameters for pattern matching.
    Must start with '/' and cannot end with '/'.
    {} represents some variable
    * - everything from this segment on will be matched (including empty strings.
    Example: /foo/bar/{}/baz/*
  • pattern.functionId * String
    The function ID
    Example: fx-12345
  • pattern.functionVersion Integer
    The function version.
    Example: 2
Response - 200

Headers
{
  "Content-Type: application/json"
}
Body
Copied!
Downloaded!
{
	"id": "fnap-123",
	"environmentId": "env-123",
	"method": "GET",
	"pattern": "/foo/bar/{}/baz/*",
	"functionId": "fx-123",
	"functionVersion": 2
}