Open navClose nav

Stacks

Get all Stack instances

Retrieves all stack instances.

Request URL

GET https://api.stackl.io/stacks/instances

A valid client certificate is required to able to access the REST API. See section Authentication

Parameters

None

Request Example

curl -X GET "https://api.stackl.io/stacks/instances" -H "accept: application/json"

Response Example

[
  {
    "name": "app01",
    "type": "stack-instance",
    "description": "App Server",
    "stackTemplate": "App Server",
    "stackTemplateAdditions": {},
    "stackTemplateSubstractions": {},
    "parameters": {
      "name": "app01.domain.local",
      "zone": "vlan10",
      "ip": "",
      "environment": "staging",
      "shape": "small",
      "location": "vmware-cluster-01"
    },
    "resources": {
      "app_server": {
        "app01.domain.local": {
          "state": "done"
        }
      }
    }
  }
]

Create or update a Stack instance

Creates or updates a stack instance with the specific id.

Request URL

POST https://api.stackl.io/stacks/instances/{stack_instance_id}/

A valid client certificate is required to able to access the REST API. See section Authentication

Parameters

Parameter Type Description
stack_instance_id string Name of the stack instance
force boolean Forces update of a stack instance
payload json string Request Body

Request Example

curl -X POST "https://api.stackl.io/stacks/instances/{stack_instance_id}/" -H "accept: application/json" -H "Content-Type: application/json" -d "{...}"

Response Example

{
  "message": "Created",
  "return_code": 201
}

Delete Stack instance

Delete a stack instance.

Request URL

DELETE https://api.stackl.io/stacks/instances/{stack_instance_id}/

A valid client certificate is required to able to access the REST API. See section Authentication

Parameters

Parameter Type Description
stack_instance_id string Id of the stack instance

Request Example

curl -X DELETE "https://api.stackl.io/stacks/instances/{stack_instance_id}/" -H "accept: application/json"

Response Example

{
  "message": "Stack-instance marked for delete",
  "return_code": 202
}

Get Stack instance

Returns a stack instance with a specific ID.

Request URL

GET https://api.stackl.io/stacks/instances/{stack_instance_id}/

A valid client certificate is required to able to access the REST API. See section Authentication

Parameters

Parameter Type Description
stack_instance_id string Id of the stack instance

Request Example

curl -X GET "https://api.stackl.io/stacks/instances/{stack_instance_id}/" -H "accept: application/json"

Response Example


Get the status of Stack instance

Returns the status for a stack instance with a specific ID.

Request URL

GET https://api.stackl.io/stacks/instances/{stack_instance_id}/status

A valid client certificate is required to able to access the REST API. See section Authentication

Parameters

Parameter Type Description
stack_instance_id string Id of the stack instance

Request Example

curl -X GET "https://api.stackl.io/stacks/instances/{stack_instance_id}/status" -H "accept: application/json"

Response Example

"In progress"

Get the full status of a Stack instance

Returns the full status for a stack instance with a specific ID/

Request URL

GET https://api.stackl.io/stacks/instances/{stack_instance_id}/status/full

A valid client certificate is required to able to access the REST API. See section Authentication

Parameters

Parameter Type Description
stack_instance_id string Id of the stack instance

Request Example

curl -X GET "https://api.stackl.io/stacks/instances/app/status/full" -H "accept: application/json"

Response Example

{
  "app_server": {
    "app01.domain.local": {
      "state": "done"
    },
    "app02.domain.local": {
      "state": "done"
    }
  },
  "app_loadbalancer": {
    "applbl.domain.local": {
      "state": "done"
    }
  },
  "app_dbserver": {
    "appdb.domain.local": {
      "state": "done"
    }
  }
}

Get all Stack Templates

Returns an array of stack templates.

Request URL

GET https://api.stackl.io/stacks/templates

A valid client certificate is required to able to access the REST API. See section Authentication

Parameters

None

Request Example

curl -X GET "https://api.stackl.io/stacks/templates" -H "accept: application/json"

Response Example

[
{
  "name": "app",
    "type": "stack-template",
      "description": "Stack Template for App",
  "parameters": {
    "count": "1",
    "db_version": "",
    "domain": "domain.local",
    "zone": "subnet-x1235",
    "app_version": "",
    "environment": "staging",
    "shape": "small",
    "location": "aws-eu-west-01",
    "name_prefix": "app"
  },
  "resources": {
    "app_server": {
      "type": "Spot::ResourceGroup",
      "properties": {
        "count": "<<count>>",
        "index_start": "0",
        "resource_def": {
          "properties": {
            "name": "<<name_prefix>><<index>>.<<domain>>",
            "zone": "<<zone>>",
            "depends_on": "<<name_prefix>>db.<<domain>>",
            "app": "<<name_prefix>>",
            "environment": "<<environment>>",
            "shape": "small",
            "role": "app",
            "location": "<<location>>",
            "app_version": "<<app_version>>",
            "database_host": "<<name_prefix>>db.<<domain>>"
          }
        }
      }
    },
    "app_loadbalancer": {
      "type": "Spot::Server",
      "properties": {
        "name": "<<name_prefix>>lbl.<<domain>>",
        "zone": "<<zone>>",
        "app": "<<app>>",
        "haproxy_backend_server_names": "<<(Array)['app_server']['name']>>",
        "environment": "<<environment>>",
        "application": "<<application>>",
        "shape": "<<shape>>",
        "role": "haproxy",
        "location": "<<location>>"
      }
    },
    "app_dbserver": {
      "type": "Spot::Server",
      "properties": {
        "name": "<<name_prefix>>db.<<domain>>",
        "zone": "<<zone>>",
        "app": "<<app>>",
        "environment": "<<environment>>",
        "application": "<<application>>",
        "shape": "<<shape>>",
        "role": "db_mysql",
        "location": "<<location>>"
      }
    }
  }
}
]

Get a specific Stack Template

Returns a stack template with a specific ID.

Request URL

GET https://api.stackl.io/stacks/templates/{stack_template_id}/

A valid client certificate is required to able to access the REST API. See section Authentication

Parameters

Parameter Type Description
stack_template_id string ID of the Stack template

Request Example

curl -X GET "https://api.stackl.io/stacks/templates/app" -H "accept: application/json"

Response Example

{
  "name": "app",
    "type": "stack-template",
      "description": "Stack Template for App",
  "parameters": {
    "count": "1",
    "db_version": "",
    "domain": "domain.local",
    "zone": "subnet-x1235",
    "app_version": "",
    "environment": "staging",
    "shape": "small",
    "location": "aws-eu-west-01",
    "name_prefix": "app"
  },
  "resources": {
    "app_server": {
      "type": "Spot::ResourceGroup",
      "properties": {
        "count": "<<count>>",
        "index_start": "0",
        "resource_def": {
          "properties": {
            "name": "<<name_prefix>><<index>>.<<domain>>",
            "zone": "<<zone>>",
            "depends_on": "<<name_prefix>>db.<<domain>>",
            "app": "<<name_prefix>>",
            "environment": "<<environment>>",
            "shape": "small",
            "role": "app",
            "location": "<<location>>",
            "app_version": "<<app_version>>",
            "database_host": "<<name_prefix>>db.<<domain>>"
          }
        }
      }
    },
    "app_loadbalancer": {
      "type": "Spot::Server",
      "properties": {
        "name": "<<name_prefix>>lbl.<<domain>>",
        "zone": "<<zone>>",
        "app": "<<app>>",
        "haproxy_backend_server_names": "<<(Array)['app_server']['name']>>",
        "environment": "<<environment>>",
        "application": "<<application>>",
        "shape": "<<shape>>",
        "role": "haproxy",
        "location": "<<location>>"
      }
    },
    "app_dbserver": {
      "type": "Spot::Server",
      "properties": {
        "name": "<<name_prefix>>db.<<domain>>",
        "zone": "<<zone>>",
        "app": "<<app>>",
        "environment": "<<environment>>",
        "application": "<<application>>",
        "shape": "<<shape>>",
        "role": "db_mysql",
        "location": "<<location>>"
      }
    }
  }
}

Create a new Stack instance from a Stack template

Creates a new stack instance from stack template.

Request URL

POST https://api.stackl.io/stacks/templates/

A valid client certificate is required to able to access the REST API. See section Authentication

Parameters

Parameter Type Description
payload json string Request Body

Request Example

curl -X POST "https://api.stackl.io/stacks/templates/" -H "accept: application/json" -H "Content-Type: application/json" -d "{...}"

Response Example



Last updated on August 23, 2018