Skip to content

Latest commit

 

History

History
686 lines (652 loc) · 29 KB

community.missing_collection.checkly_checks_module.rst

File metadata and controls

686 lines (652 loc) · 29 KB

community.missing_collection.checkly_checks

Management of the checkly Checks.

Version added: 0.3.0

The below requirements are needed on the host that executes this module.

  • requests
Parameter Choices/Defaults Comments
activated
boolean
    Choices:
  • no
  • yes ←
Determines if the check is running or not.
alert_channel_subscriptions
list
Default:
[]
List of alert channel subscriptions.
alert_settings
dictionary
Default:
{}
Alert settings.
api_key
string / required
api key for checkly.
auto_assign_alerts
boolean
    Choices:
  • no
  • yes ←
nothing mentioned in api docs.
check_type
string
    Choices:
  • BROWSER
  • API ←
The type of the check.
command
string
    Choices:
  • create ←
  • update
  • delete
type of operation on checks.
degraded_response_time
integer
Default:
10000
The response time in milliseconds where a check should be considered degraded.
double_check
boolean
    Choices:
  • no
  • yes ←
Setting this to "true" will trigger a retry when a check fails from the failing region and another,
randomly selected region before marking the check as failed.
environment_variables
list
Default:
[]
Key/value pairs for setting environment variables during check execution.
These are only relevant for Browser checks.
Use global environment variables whenever possible.
frequency
integer
Default:
60
how often the check should run in minutes.
frequency_offset
integer
Used for setting seconds for check frequencies under 1 minutes (only for API checks)
and spreading checks over a time range for frequencies over 1 minute.
This works as follows Checks with a frequency of 0 can have a frequencyOffset of 10, 20 or 30 meaning they will run every 10, 20 or 30 seconds.
Checks with a frequency lower than and equal to 60 can have a frequencyOffset between 1 and a max value based on the formula "Math.floor(frequency * 10)",
i.e. for a check that runs every 5 minutes the max frequencyOffset is 50.
Checks with a frequency higher than 60 can have a frequencyOffset between 1 and a max value based on the formula "Math.ceil(frequency / 60)",
i.e. for a check that runs every 720 minutes, the max frequencyOffset is 12.
group_id
integer
The id of the check group this check is part of.
group_order
integer
The position of this check in a check group.
It determines in what order checks are run when a group is triggered from the API or from CI/CD.
id
string
id of check.
required only for delete and update.
local_setup_script
string
A valid piece of Node.js code to run in the setup phase.
local_tear_down_script
string
A valid piece of Node.js code to run in the teardown phase.
locations
list
Default:
["ap-south-1"]
An array of one or more data center locations where to run the this check.
max_response_time
integer
Default:
20000
The response time in milliseconds where a check should be considered failing.
muted
boolean
    Choices:
  • no ←
  • yes
Determines if any notifications will be send out when a check fails and/or recovers.
name
string
name of the check.
request
dictionary
request object.
runtime_id
string
    Choices:
  • 2021.06 ←
  • 2020.01
The runtime version, i.e. fixed set of runtime dependencies, used to execute this check.
script
string
nodejs based script.
nothing mentioned in api docs.
setup_snippet_id
integer
An ID reference to a snippet to use in the setup phase of an API check.
should_fail
boolean
    Choices:
  • no ←
  • yes
Allows to invert the behaviour of when a check is considered to fail.
Allows for validating error status like 404.
ssl_check
boolean
    Choices:
  • no ←
  • yes
Determines if the SSL certificate should be validated for expiry.
tags
list
Default:
[]
A list of one or more tags that filter which checks to display on the dashboard.
tear_down_snippet_id
integer
An ID reference to a snippet to use in the teardown phase of an API check.
url
string
Default:
checkly api.
use_global_alert_settings
boolean
    Choices:
  • no
  • yes ←
When true, the account level alert setting will be used,
not the alert setting defined on this check.

- name: create a check
  community.missing_collection.checkly_checks:
    api_key: 'c18803aafff44ec091558db24aa87098'
    command: 'create'
    name: 'Ansible API Check'
    check_type: "API"
    request:
      assertions:
        - comparison: "EQUALS"
          property: ""
          source: "STATUS_CODE"
          target: "200"
      basicAuth:
        password: ""
        username: ""
      body: ""
      bodyType: "NONE"
      followRedirects: true
      headers: []
      method: "GET"
      queryParameters: []
      url: "https://www.axway.com/"
    alert_channel_subscriptions:
      - activated: true
        alertChannelId: 39739
    alert_settings:
      escalationType: "RUN_BASED"
      reminders:
        amount: 0
        interval: 5
      runBasedEscalation:
        failedRunThreshold: 1
      sslCertificates:
        alertThreshold: 30
        enabled: true
      timeBasedEscalation:
        minutesFailingThreshold: 5
    use_global_alert_settings: false
    tags:
      - 'api'
      - 'axway'
  register: __

# doesn't work yet - Internal Server Error
- name: update a check
  community.missing_collection.checkly_checks:
    api_key: 'c18803aafff44ec091558db24aa87098'
    command: 'update'
    name: 'New Ansible API Check'
    id: '{{ __.result.id }}'
    request:
      method: "GET"
      url: "https://example.com/"

- name: delete a check
  community.missing_collection.checkly_checks:
    api_key: 'c18803aafff44ec091558db24aa87098'
    command: 'delete'
    id: '{{ __.result.id }}'

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
result
dictionary
when command is create/update and success.
result of checkly api.

Sample:
{'id': 'string', 'name': 'string', 'checkType': 'BROWSER', 'frequency': 10, 'frequencyOffset': 1, 'activated': True, 'muted': False, 'doubleCheck': True, 'sslCheck': True, 'shouldFail': True, 'locations': [], 'request': {}, 'script': 'string', 'environmentVariables': [], 'tags': [], 'setupSnippetId': 0, 'tearDownSnippetId': 0, 'localSetupScript': 'string', 'localTearDownScript': 'string', 'alertSettings': {}, 'useGlobalAlertSettings': True, 'degradedResponseTime': 10000, 'maxResponseTime': 20000, 'groupId': 0, 'groupOrder': 0, 'runtimeId': '2021.06', 'alertChannelSubscriptions': [], 'alertChannels': {}, 'created_at': '2019-08-24', 'updated_at': '2019-08-24T14:15:22Z'}


Authors