Open navClose nav

Types

For more information about the different types, see section Object Types.

Get All Types

Retrieves all the valid types.

Request URL

GET https://api.stackl.io/types

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/types" -H "accept: application/json"

Response Example

{
  "types": [
    "all",
    "zone",
    "environment",
    "stack-template",
    "shape",
    "stack-snapshot",
    "role",
    "location",
    "action",
    "stack-instance",
    "configuration",
    "clientcert",
    "common"
  ]
}

Get all objects of a specific type

Returns all objects of a specific type.

Request URL

GET https://api.stackl.io/types/{type_name}/

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

Parameters

Parameter Type Description
type_name string Name of the object type

Request Example

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

Response Example

{
  "result": [
    {
      "type": "environment",
      "description": "Demo Environment",
      "name": "demo"
    },
    {
      "type": "environment",
      "description": "Production Environment",
      "name": "production"
    },
    {
      "type": "environment",
      "name": "staging",
      "description": "Staging Environment"
    }
  ]
}

Create a new object type

Create new object of a specific type.

Request URL

POST https://api.stackl.io/types/{typename}/

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

Parameters

Parameter Type Description
typename string Name of the object type
payload json string Request Body

Request Example

curl -X POST "https://api.stackl.io/types/environment" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"name\": \"staging\", \"description\": \"Staging environment\"}"

Response Example

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

Delete an Object Type

Deletes a specific type object.

Request URL

DELETE https://api.stackl.io/types/{type_name}/{type_id}/

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

Parameters

Parameter Type Description
type_name string Name of the object type
type_id string Id of the object type

Request Example

curl -X DELETE "https://api.stackl.io/types/environment/staging" -H "accept: application/json"

Response Example

{
  "message": "Document removed successfully!",
  "return_code": 200
}

Get a specific type object

Returns a specific type object.

Request URL

GET https://api.stackl.io/types/{type_name}/{type_id}/

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

Parameters

Parameter Type Description
type_name string Name of the object type
type_id string Id of the object type

Request Example

curl -X GET "https://api.stackl.io/types/environment/production" -H "accept: application/json"

Response Example

{
  "type": "environment",
  "description": "Production Environment",
  "name": "production"
}

Last updated on August 23, 2018