Stacks — bodhi 3.1.0 documentation

# Stacks

## Stack service at /stacks/{name}

Bodhi Stacks

### GET

Accepted content types:

- application/javascript

Return a single Stack from its name.

Args:
  request (pyramid.request): The current web request.
Returns:
  dict: A dictionary with key “stack” that indexes the matched Stack.

Make sure this singular stack exists.

Args:
  request (pyramid.util.Request): The current request. kwargs (dict): The kwargs of the related service definition. Unused.

Response: jsonp

### GET

Accepted content types:

- application/json
- text/json

Return a single Stack from its name.

Args:
  request (pyramid.request): The current web request.
Returns:
  dict: A dictionary with key “stack” that indexes the matched Stack.

Make sure this singular stack exists.

Args:
  request (pyramid.util.Request): The current request. kwargs (dict): The kwargs of the related service definition. Unused.

Response: json

### GET

Accepted content types:

- text/html

Return a single Stack from its name.

Args:
  request (pyramid.request): The current web request.
Returns:
  dict: A dictionary with key “stack” that indexes the matched Stack.

Make sure this singular stack exists.

Args:
  request (pyramid.util.Request): The current request. kwargs (dict): The kwargs of the related service definition. Unused.

Response: new_stack.html

### DELETE

Delete a stack.

Args:
  request (pyramid.request): The current web request.
Returns:
  dict: The dictionary {‘status’: ‘success’}.

Make sure this singular stack exists.

Args:
  request (pyramid.util.Request): The current request. kwargs (dict): The kwargs of the related service definition. Unused.

Response: json

## Stacks service at /stacks/

Bodhi Stacks

### GET

values in the querystring

- like (String) - (optional)
- search (String) - (optional)
- chrome (Boolean) - (default: true)
- page (Integer) - (default: 1)
- rows_per_page (Integer) - (default: 20)
- name (String) - (optional)
- packages (Sequence) - (optional)

Accepted content types:

- application/json
- text/json

Return a paginated list of filtered stacks.

Args:
  request (pyramid.request): The current web request.
Returns:
  dict: A dictionary with the following keys: “stacks” indexing a list of Stacks that match
    the query, “page” indexing the current page, “pages” indexing the total number of pages, “rows_per_page” indexing how many rows are in a page, and “total” indexing the total number of matched Stacks.

Validate the location against the schema defined on the service.

The content of the location is deserialized, validated and stored in the `request.validated` attribute.

Note

If no schema is defined, this validator does nothing.

Param request: | Current request
Type request: | `Request`
Param schema: | The Colander schema
Param deserializer:
| Optional deserializer, defaults to `cornice.validators.extract_cstruct()`

Make sure referenced packages exist.

Args:
  request (pyramid.util.Request): The current request. kwargs (dict): The kwargs of the related service definition. Unused.

Response: json

### GET

values in the querystring

- like (String) - (optional)
- search (String) - (optional)
- chrome (Boolean) - (default: true)
- page (Integer) - (default: 1)
- rows_per_page (Integer) - (default: 20)
- name (String) - (optional)
- packages (Sequence) - (optional)

Accepted content types:

- text/html

Return a paginated list of filtered stacks.

Args:
  request (pyramid.request): The current web request.
Returns:
  dict: A dictionary with the following keys: “stacks” indexing a list of Stacks that match
    the query, “page” indexing the current page, “pages” indexing the total number of pages, “rows_per_page” indexing how many rows are in a page, and “total” indexing the total number of matched Stacks.

Validate the location against the schema defined on the service.

The content of the location is deserialized, validated and stored in the `request.validated` attribute.

Note

If no schema is defined, this validator does nothing.

Param request: | Current request
Type request: | `Request`
Param schema: | The Colander schema
Param deserializer:
| Optional deserializer, defaults to `cornice.validators.extract_cstruct()`

Make sure referenced packages exist.

Args:
  request (pyramid.util.Request): The current request. kwargs (dict): The kwargs of the related service definition. Unused.

Response: stacks.html

### POST

values in the body

- csrf_token (String)
- name (String)
- packages (Sequence) - (optional)
- description (String) - (optional)
- requirements (String) - (optional)

Save a stack.

Args:
  request (pyramid.request): The current web request.
Returns:
  dict: A dictionary with key “stack” that indexes the newly created Stack.

Validate the body against the schema defined on the service.

The content of the body is deserialized, validated and stored in the `request.validated` attribute.

Note

If no schema is defined, this validator does nothing.

Param request: | Current request
Type request: | `Request`
Param schema: | The Colander schema
Param deserializer:
| Optional deserializer, defaults to `cornice.validators.extract_cstruct()`

Validate the requirements parameter for the stack.

Args:
  request (pyramid.util.Request): The current request. kwargs (dict): The kwargs of the related service definition. Unused.

Response: json