cisco.meraki.networks_sensor_alerts_profiles (2.18.0) — module

Resource module for networks _sensor _alerts _profiles

| "added in version" 2.16.0 of cisco.meraki"

Authors: Francisco Munoz (@fmunoz)

This plugin has a corresponding action plugin.

Install collection

Install with ansible-galaxy collection install cisco.meraki:==2.18.0


Add to requirements.yml

  collections:
    - name: cisco.meraki
      version: 2.18.0

Description

Manage operations create, update and delete of the resource networks _sensor _alerts _profiles.

Creates a sensor alert profile for a network.

Deletes a sensor alert profile from a network.

Updates a sensor alert profile for a network.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create
  cisco.meraki.networks_sensor_alerts_profiles:
    meraki_api_key: "{{meraki_api_key}}"
    meraki_base_url: "{{meraki_base_url}}"
    meraki_single_request_timeout: "{{meraki_single_request_timeout}}"
    meraki_certificate_path: "{{meraki_certificate_path}}"
    meraki_requests_proxy: "{{meraki_requests_proxy}}"
    meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}"
    meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}"
    meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}"
    meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}"
    meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}"
    meraki_maximum_retries: "{{meraki_maximum_retries}}"
    meraki_output_log: "{{meraki_output_log}}"
    meraki_log_file_prefix: "{{meraki_log_file_prefix}}"
    meraki_log_path: "{{meraki_log_path}}"
    meraki_print_console: "{{meraki_print_console}}"
    meraki_suppress_logging: "{{meraki_suppress_logging}}"
    meraki_simulate: "{{meraki_simulate}}"
    meraki_be_geo_id: "{{meraki_be_geo_id}}"
    meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}"
    meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}"
    state: present
    conditions:
    - direction: above
      duration: 60
      metric: temperature
      threshold:
        apparentPower:
          draw: 17.2
        current:
          draw: 0.14
        door:
          open: true
        frequency:
          level: 58.8
        humidity:
          quality: inadequate
          relativePercentage: 65
        indoorAirQuality:
          quality: fair
          score: 80
        noise:
          ambient:
            level: 120
            quality: poor
        pm25:
          concentration: 90
          quality: fair
        powerFactor:
          percentage: 81
        realPower:
          draw: 14.1
        temperature:
          celsius: 20.5
          fahrenheit: 70.0
          quality: good
        tvoc:
          concentration: 400
          quality: poor
        upstreamPower:
          outageDetected: true
        voltage:
          level: 119.5
        water:
          present: true
    name: My Sensor Alert Profile
    networkId: string
    recipients:
      emails:
      - miles@meraki.com
      httpServerIds:
      - aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M=
      smsNumbers:
      - '+15555555555'
    schedule:
      id: '5'
    serials:
    - Q234-ABCD-0001
    - Q234-ABCD-0002
    - Q234-ABCD-0003
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete by id
  cisco.meraki.networks_sensor_alerts_profiles:
    meraki_api_key: "{{meraki_api_key}}"
    meraki_base_url: "{{meraki_base_url}}"
    meraki_single_request_timeout: "{{meraki_single_request_timeout}}"
    meraki_certificate_path: "{{meraki_certificate_path}}"
    meraki_requests_proxy: "{{meraki_requests_proxy}}"
    meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}"
    meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}"
    meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}"
    meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}"
    meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}"
    meraki_maximum_retries: "{{meraki_maximum_retries}}"
    meraki_output_log: "{{meraki_output_log}}"
    meraki_log_file_prefix: "{{meraki_log_file_prefix}}"
    meraki_log_path: "{{meraki_log_path}}"
    meraki_print_console: "{{meraki_print_console}}"
    meraki_suppress_logging: "{{meraki_suppress_logging}}"
    meraki_simulate: "{{meraki_simulate}}"
    meraki_be_geo_id: "{{meraki_be_geo_id}}"
    meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}"
    meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}"
    state: absent
    id: string
    networkId: string
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Update by id
  cisco.meraki.networks_sensor_alerts_profiles:
    meraki_api_key: "{{meraki_api_key}}"
    meraki_base_url: "{{meraki_base_url}}"
    meraki_single_request_timeout: "{{meraki_single_request_timeout}}"
    meraki_certificate_path: "{{meraki_certificate_path}}"
    meraki_requests_proxy: "{{meraki_requests_proxy}}"
    meraki_wait_on_rate_limit: "{{meraki_wait_on_rate_limit}}"
    meraki_nginx_429_retry_wait_time: "{{meraki_nginx_429_retry_wait_time}}"
    meraki_action_batch_retry_wait_time: "{{meraki_action_batch_retry_wait_time}}"
    meraki_retry_4xx_error: "{{meraki_retry_4xx_error}}"
    meraki_retry_4xx_error_wait_time: "{{meraki_retry_4xx_error_wait_time}}"
    meraki_maximum_retries: "{{meraki_maximum_retries}}"
    meraki_output_log: "{{meraki_output_log}}"
    meraki_log_file_prefix: "{{meraki_log_file_prefix}}"
    meraki_log_path: "{{meraki_log_path}}"
    meraki_print_console: "{{meraki_print_console}}"
    meraki_suppress_logging: "{{meraki_suppress_logging}}"
    meraki_simulate: "{{meraki_simulate}}"
    meraki_be_geo_id: "{{meraki_be_geo_id}}"
    meraki_use_iterator_for_get_pages: "{{meraki_use_iterator_for_get_pages}}"
    meraki_inherit_logging_config: "{{meraki_inherit_logging_config}}"
    state: present
    conditions:
    - direction: above
      duration: 60
      metric: temperature
      threshold:
        apparentPower:
          draw: 17.2
        current:
          draw: 0.14
        door:
          open: true
        frequency:
          level: 58.8
        humidity:
          quality: inadequate
          relativePercentage: 65
        indoorAirQuality:
          quality: fair
          score: 80
        noise:
          ambient:
            level: 120
            quality: poor
        pm25:
          concentration: 90
          quality: fair
        powerFactor:
          percentage: 81
        realPower:
          draw: 14.1
        temperature:
          celsius: 20.5
          fahrenheit: 70.0
          quality: good
        tvoc:
          concentration: 400
          quality: poor
        upstreamPower:
          outageDetected: true
        voltage:
          level: 119.5
        water:
          present: true
    id: string
    name: My Sensor Alert Profile
    networkId: string
    recipients:
      emails:
      - miles@meraki.com
      httpServerIds:
      - aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M=
      smsNumbers:
      - '+15555555555'
    schedule:
      id: '5'
    serials:
    - Q234-ABCD-0001
    - Q234-ABCD-0002
    - Q234-ABCD-0003

Inputs

    
id:
    description: Id path parameter.
    type: str

name:
    description: Name of the sensor alert profile.
    type: str

serials:
    description: List of device serials assigned to this sensor alert profile.
    elements: str
    type: list

schedule:
    description: The sensor schedule to use with the alert profile.
    suboptions:
      id:
        description: ID of the sensor schedule to use with the alert profile. If not defined,
          the alert profile will be active at all times.
        type: str
    type: dict

networkId:
    description: NetworkId path parameter. Network ID.
    type: str

conditions:
    description: List of conditions that will cause the profile to send an alert.
    elements: dict
    suboptions:
      direction:
        description: If 'above', an alert will be sent when a sensor reads above the threshold.
          If 'below', an alert will be sent when a sensor reads below the threshold. Only
          applicable for temperature, humidity, realPower, apparentPower, powerFactor,
          voltage, current, and frequency thresholds.
        type: str
      duration:
        description: Length of time in seconds that the triggering state must persist
          before an alert is sent. Available options are 0 seconds, 1 minute, 2 minutes,
          3 minutes, 4 minutes, 5 minutes, 10 minutes, 15 minutes, 30 minutes, 1 hour,
          2 hours, 4 hours, and 8 hours. Default is 0.
        type: int
      metric:
        description: The type of sensor metric that will be monitored for changes. Available
          metrics are apparentPower, co2, current, door, frequency, humidity, indoorAirQuality,
          noise, pm25, powerFactor, realPower, temperature, tvoc, upstreamPower, voltage,
          and water.
        type: str
      threshold:
        description: Threshold for sensor readings that will cause an alert to be sent.
          This object should contain a single property key matching the condition's 'metric'
          value.
        suboptions:
          apparentPower:
            description: Apparent power threshold. 'draw' must be provided.
            suboptions:
              draw:
                description: Alerting threshold in volt-amps. Must be between 0 and 3750.
                type: float
            type: dict
          current:
            description: Electrical current threshold. 'level' must be provided.
            suboptions:
              draw:
                description: Alerting threshold in amps. Must be between 0 and 15.
                type: float
            type: dict
          door:
            description: Door open threshold. 'open' must be provided and set to true.
            suboptions:
              open:
                description: Alerting threshold for a door open event. Must be set to
                  true.
                type: bool
            type: dict
          frequency:
            description: Electrical frequency threshold. 'level' must be provided.
            suboptions:
              level:
                description: Alerting threshold in hertz. Must be between 0 and 60.
                type: float
            type: dict
          humidity:
            description: Humidity threshold. One of 'relativePercentage' or 'quality'
              must be provided.
            suboptions:
              quality:
                description: Alerting threshold as a qualitative humidity level.
                type: str
              relativePercentage:
                description: Alerting threshold in %RH.
                type: int
            type: dict
          indoorAirQuality:
            description: Indoor air quality score threshold. One of 'score' or 'quality'
              must be provided.
            suboptions:
              quality:
                description: Alerting threshold as a qualitative indoor air quality level.
                type: str
              score:
                description: Alerting threshold as indoor air quality score.
                type: int
            type: dict
          noise:
            description: Noise threshold. 'ambient' must be provided.
            suboptions:
              ambient:
                description: Ambient noise threshold. One of 'level' or 'quality' must
                  be provided.
                suboptions:
                  level:
                    description: Alerting threshold as adjusted decibels.
                    type: int
                  quality:
                    description: Alerting threshold as a qualitative ambient noise level.
                    type: str
                type: dict
            type: dict
          pm25:
            description: PM2.5 concentration threshold. One of 'concentration' or 'quality'
              must be provided.
            suboptions:
              concentration:
                description: Alerting threshold as PM2.5 parts per million.
                type: int
              quality:
                description: Alerting threshold as a qualitative PM2.5 level.
                type: str
            type: dict
          powerFactor:
            description: Power factor threshold. 'percentage' must be provided.
            suboptions:
              percentage:
                description: Alerting threshold as the ratio of active power to apparent
                  power. Must be between 0 and 100.
                type: int
            type: dict
          realPower:
            description: Real power threshold. 'draw' must be provided.
            suboptions:
              draw:
                description: Alerting threshold in watts. Must be between 0 and 3750.
                type: float
            type: dict
          temperature:
            description: Temperature threshold. One of 'celsius', 'fahrenheit', or 'quality'
              must be provided.
            suboptions:
              celsius:
                description: Alerting threshold in degrees Celsius.
                type: float
              fahrenheit:
                description: Alerting threshold in degrees Fahrenheit.
                type: float
              quality:
                description: Alerting threshold as a qualitative temperature level.
                type: str
            type: dict
          tvoc:
            description: TVOC concentration threshold. One of 'concentration' or 'quality'
              must be provided.
            suboptions:
              concentration:
                description: Alerting threshold as TVOC micrograms per cubic meter.
                type: int
              quality:
                description: Alerting threshold as a qualitative TVOC level.
                type: str
            type: dict
          upstreamPower:
            description: Upstream power threshold. 'outageDetected' must be provided and
              set to true.
            suboptions:
              outageDetected:
                description: Alerting threshold for an upstream power event. Must be set
                  to true.
                type: bool
            type: dict
          voltage:
            description: Voltage threshold. 'level' must be provided.
            suboptions:
              level:
                description: Alerting threshold in volts. Must be between 0 and 250.
                type: float
            type: dict
          water:
            description: Water detection threshold. 'present' must be provided and set
              to true.
            suboptions:
              present:
                description: Alerting threshold for a water detection event. Must be set
                  to true.
                type: bool
            type: dict
        type: dict
    type: list

recipients:
    description: List of recipients that will receive the alert.
    suboptions:
      emails:
        description: A list of emails that will receive information about the alert.
        elements: str
        type: list
      httpServerIds:
        description: A list of webhook endpoint IDs that will receive information about
          the alert.
        elements: str
        type: list
      smsNumbers:
        description: A list of SMS numbers that will receive information about the alert.
        elements: str
        type: list
    type: dict

meraki_caller:
    default: ''
    description:
    - meraki_caller (string), optional identifier for API usage tracking; can also be
      set as an environment variable MERAKI_PYTHON_SDK_CALLER
    type: str

meraki_api_key:
    description:
    - meraki_api_key (string), API key generated in dashboard; can also be set as an environment
      variable MERAKI_DASHBOARD_API_KEY
    required: true
    type: str

meraki_base_url:
    default: https://api.meraki.com/api/v1
    description:
    - meraki_base_url (string), preceding all endpoint resources
    type: str

meraki_log_path:
    default: ''
    description:
    - log_path (string), path to output log; by default, working directory of script if
      not specified
    type: str

meraki_simulate:
    default: false
    description:
    - meraki_simulate (boolean), simulate POST/PUT/DELETE calls to prevent changes?
    type: bool

meraki_be_geo_id:
    default: ''
    description:
    - meraki_be_geo_id (string), optional partner identifier for API usage tracking; can
      also be set as an environment variable BE_GEO_ID
    type: str

meraki_output_log:
    default: true
    description:
    - meraki_output_log (boolean), create an output log file?
    type: bool

meraki_print_console:
    default: true
    description:
    - meraki_print_console (boolean), print logging output to console?
    type: bool

meraki_requests_proxy:
    default: ''
    description:
    - meraki_requests_proxy (string), proxy server and port, if needed, for HTTPS
    type: str

meraki_log_file_prefix:
    default: meraki_api_
    description:
    - meraki_log_file_prefix (string), log file name appended with date and timestamp
    type: str

meraki_maximum_retries:
    default: 2
    description:
    - meraki_maximum_retries (integer), retry up to this many times when encountering
      429s or other server-side errors
    type: int

meraki_retry_4xx_error:
    default: false
    description:
    - meraki_retry_4xx_error (boolean), retry if encountering other 4XX error (besides
      429)?
    type: bool

meraki_certificate_path:
    default: ''
    description:
    - meraki_certificate_path (string), path for TLS/SSL certificate verification if behind
      local proxy
    type: str

meraki_suppress_logging:
    default: false
    description:
    - meraki_suppress_logging (boolean), disable all logging? you're on your own then!
    type: bool

meraki_wait_on_rate_limit:
    default: true
    description:
    - meraki_wait_on_rate_limit (boolean), retry if 429 rate limit error encountered?
    type: bool

meraki_inherit_logging_config:
    default: false
    description:
    - meraki_inherit_logging_config (boolean), Inherits your own logger instance
    type: bool

meraki_single_request_timeout:
    default: 60
    description:
    - meraki_single_request_timeout (integer), maximum number of seconds for each API
      call
    type: int

meraki_nginx_429_retry_wait_time:
    default: 60
    description:
    - meraki_nginx_429_retry_wait_time (integer), Nginx 429 retry wait time
    type: int

meraki_retry_4xx_error_wait_time:
    default: 60
    description:
    - meraki_retry_4xx_error_wait_time (integer), other 4XX error retry wait time
    type: int

meraki_use_iterator_for_get_pages:
    default: false
    description:
    - meraki_use_iterator_for_get_pages (boolean), list* methods will return an iterator
      with each object instead of a complete list with all items
    type: bool

meraki_action_batch_retry_wait_time:
    default: 60
    description:
    - meraki_action_batch_retry_wait_time (integer), action batch concurrency error retry
      wait time
    type: int

Outputs

meraki_response:
  description: A dictionary or list with the response returned by the Cisco Meraki
    Python SDK
  returned: always
  sample: "{\n  \"conditions\": [\n    {\n      \"direction\": \"string\",\n     \
    \ \"duration\": 0,\n      \"metric\": \"string\",\n      \"threshold\": {\n  \
    \      \"apparentPower\": {\n          \"draw\": 0\n        },\n        \"current\"\
    : {\n          \"draw\": 0\n        },\n        \"door\": {\n          \"open\"\
    : true\n        },\n        \"frequency\": {\n          \"level\": 0\n       \
    \ },\n        \"humidity\": {\n          \"quality\": \"string\",\n          \"\
    relativePercentage\": 0\n        },\n        \"indoorAirQuality\": {\n       \
    \   \"quality\": \"string\",\n          \"score\": 0\n        },\n        \"noise\"\
    : {\n          \"ambient\": {\n            \"level\": 0,\n            \"quality\"\
    : \"string\"\n          }\n        },\n        \"pm25\": {\n          \"concentration\"\
    : 0,\n          \"quality\": \"string\"\n        },\n        \"powerFactor\":\
    \ {\n          \"percentage\": 0\n        },\n        \"realPower\": {\n     \
    \     \"draw\": 0\n        },\n        \"temperature\": {\n          \"celsius\"\
    : 0,\n          \"fahrenheit\": 0,\n          \"quality\": \"string\"\n      \
    \  },\n        \"tvoc\": {\n          \"concentration\": 0,\n          \"quality\"\
    : \"string\"\n        },\n        \"upstreamPower\": {\n          \"outageDetected\"\
    : true\n        },\n        \"voltage\": {\n          \"level\": 0\n        },\n\
    \        \"water\": {\n          \"present\": true\n        }\n      }\n    }\n\
    \  ],\n  \"name\": \"string\",\n  \"profileId\": \"string\",\n  \"recipients\"\
    : {\n    \"emails\": [\n      \"string\"\n    ],\n    \"httpServerIds\": [\n \
    \     \"string\"\n    ],\n    \"smsNumbers\": [\n      \"string\"\n    ]\n  },\n\
    \  \"schedule\": {\n    \"id\": \"string\",\n    \"name\": \"string\"\n  },\n\
    \  \"serials\": [\n    \"string\"\n  ]\n}\n"
  type: dict

See also