Skip to content

Extras

Instance/Request Hooks

Instance/Requests hooks are a way to call a RHAAP/AWX job template following the new state of a Request or an Instance.

For example, if you want to call a job template that performs an action everytime a Request switch to FAILED state.

Create a RequestHook:

  • name: Name of your hook
  • State: The hook will be triggered when an instance of the select model type will switch to this selected state
  • Job template: The RHAAP/AWX job template to execute when an instance of the selected model reach the selected state
  • Extra vars: extra variable as JSON to add to the selected job template

States documentation:

Announcements

Announcements allow Squest administrator to notify users. Announcements are displayed to end users in the main Squest page.

Administrator defines beginning, end, title, message and type of announcement.

Note

Configure your time zone.

Custom links allow to display hyperlinks to external content by using Squest instance attributes. Custom links appear as buttons in the top right corner of an instance detail page. Jinja template can be used to insert data from the current squest instance details like instance.spec.

For example a link can be created to expose the Hypervisor URL that has been placed into the instance spec of a created resource.

Name Required Comment
name true Name of the custom link. When loop is used, the name is used for the dropdown button name
services true Define in which instance details page the button will appear
text true Text in the button. Jinja template supported
url true URL of the link. Jinja template supported
button color false Color of the displayed button
when false Ansible like "when" condition
loop false Ansible like "loop"
Enabled false Enable or disable the button
Is admin only false When set to true, only Squest administrators can see the button

Jinja templating

Jinja templating can be used in the text or URL definition. The instance object of the current instance detail page is used as context.

Full instance object definition can be retrieved through the API documentation.

Instance spec example:

{
  "key1": "value1"
}

Button text example:

Button {{ instance.name }}

Button url example:

https://external_resource.domain/?name={{ instance.spec.key1 }}

Rendered button with an instance named "k8S ns test":

<a href="https://external_resource.domain/?name=value1">Button k8S ns test</a>

When condition

The when condition allow to display the button only on certain condition like the "when" flag on Ansible.

E.g:

spec['configvar'] == 'value' and user_spec['other'] == 'value'

Note

Like for Ansible, double curly braces are not used in 'when' declaration.

Loop

When the loop definition is set, a dropdown button is created with a link for each element of the given list. Like for Ansible, the element is exposed as item in the Jinja template of the button text or URL.

Instance spec example:

{
  "my_list": [
    "item1",
    "item2"
  ]
}

Loop example:

{{ instance.spec.my_list }}

Button text example:

name: {{ item }}

Button url example:

https://external_resource.domain/{{ item }}

Rendered links into the dropdown button:

<a href="https://external_resource.domain/item1">name: item1</a>
<a href="https://external_resource.domain/item2">name: item2</a>

Email template

The Email template functionality allows Squest administrators to craft a message intended for future delivery to a selected group of Squest users via email.

Emails are composed a title and an HTML content.

Optionally, it is possible to establish filters such as services, instance states, and quota scopes, which can be employed to refine the ultimate recipient list. When the email is dispatched, Squest will present a list of users that align with the specified filters.

Note

The act of creating a template does not result in the sending of any emails. After a template has been created, the "send" button grants the administrator the ability to make modifications to the ultimate list of users before initiating the email dispatch.

A when condition can be also added to filter instances of the same service to particular criteria based for example on the instance specs. Example of when condition:

instance.user_spec.location == 'grenoble'