| 1 |
#!/usr/bin/python |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
|
| 4 |
# Copyright (c) 2021, Cisco Systems |
| 5 |
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 6 |
|
| 7 |
DOCUMENTATION = r""" |
| 8 |
module: devices_sensor_commands_info |
| 9 |
short_description: Information module for devices _sensor _commands |
| 10 |
description: |
| 11 |
- Information module for Devices Sensor Commands Info. |
| 12 |
- Get all devices _sensor _commands. |
| 13 |
- Get devices _sensor _commands by id. |
| 14 |
- Returns a historical log of all commands. |
| 15 |
- Returns information about the command's execution, including the status. |
| 16 |
version_added: '1.0.0' |
| 17 |
extends_documentation_fragment: |
| 18 |
- cisco.meraki.module_info |
| 19 |
- cisco.meraki.module_info_pagination |
| 20 |
author: Francisco Munoz (@fmunoz) |
| 21 |
options: |
| 22 |
headers: |
| 23 |
description: Additional headers. |
| 24 |
type: dict |
| 25 |
serial: |
| 26 |
description: |
| 27 |
- Information module for Devices Sensor Commands Info. |
| 28 |
- Serial path parameter. |
| 29 |
type: str |
| 30 |
operations: |
| 31 |
description: |
| 32 |
- Information module for Devices Sensor Commands Info. |
| 33 |
- > |
| 34 |
Operations query parameter. Optional parameter to filter commands by operation. |
| 35 |
Allowed values are disableDownstreamPower, enableDownstreamPower, cycleDownstreamPower, |
| 36 |
and refreshData. |
| 37 |
elements: str |
| 38 |
type: list |
| 39 |
perPage: |
| 40 |
description: |
| 41 |
- Information module for Devices Sensor Commands Info. |
| 42 |
- PerPage query parameter. The number of entries per page returned. Acceptable |
| 43 |
range is 3 - 1000. Default is 10. |
| 44 |
type: int |
| 45 |
startingAfter: |
| 46 |
description: |
| 47 |
- Information module for Devices Sensor Commands Info. |
| 48 |
- > |
| 49 |
StartingAfter query parameter. A token used by the server to indicate the |
| 50 |
start of the page. Often this is a timestamp or an ID but it is not limited |
| 51 |
to those. This parameter should not be defined by client applications. The |
| 52 |
link for the first, last, prev, or next page in the HTTP Link header should |
| 53 |
define it. |
| 54 |
type: str |
| 55 |
endingBefore: |
| 56 |
description: |
| 57 |
- Information module for Devices Sensor Commands Info. |
| 58 |
- > |
| 59 |
EndingBefore query parameter. A token used by the server to indicate the end |
| 60 |
of the page. Often this is a timestamp or an ID but it is not limited to those. |
| 61 |
This parameter should not be defined by client applications. The link for |
| 62 |
the first, last, prev, or next page in the HTTP Link header should define |
| 63 |
it. |
| 64 |
type: str |
| 65 |
sortOrder: |
| 66 |
description: |
| 67 |
- Information module for Devices Sensor Commands Info. |
| 68 |
- > |
| 69 |
SortOrder query parameter. Sorted order of entries. Order options are 'ascending' |
| 70 |
and 'descending'. Default is 'descending'. |
| 71 |
type: str |
| 72 |
t0: |
| 73 |
description: |
| 74 |
- Information module for Devices Sensor Commands Info. |
| 75 |
- T0 query parameter. The beginning of the timespan for the data. The maximum |
| 76 |
lookback period is 30 days from today. |
| 77 |
type: str |
| 78 |
t1: |
| 79 |
description: |
| 80 |
- Information module for Devices Sensor Commands Info. |
| 81 |
- T1 query parameter. The end of the timespan for the data. T1 can be a maximum |
| 82 |
of 30 days after t0. |
| 83 |
type: str |
| 84 |
timespan: |
| 85 |
description: |
| 86 |
- Information module for Devices Sensor Commands Info. |
| 87 |
- > |
| 88 |
Timespan query parameter. The timespan for which the information will be fetched. |
| 89 |
If specifying timespan, do not specify parameters t0 and t1. The value must |
| 90 |
be in seconds and be less than or equal to 30 days. The default is 30 days. |
| 91 |
type: float |
| 92 |
commandId: |
| 93 |
description: |
| 94 |
- Information module for Devices Sensor Commands Info. |
| 95 |
- CommandId path parameter. Command ID. |
| 96 |
type: str |
| 97 |
requirements: |
| 98 |
- meraki >= 2.4.9 |
| 99 |
- python >= 3.5 |
| 100 |
seealso: |
| 101 |
- name: Cisco Meraki documentation for sensor getDeviceSensorCommand |
| 102 |
description: Complete reference of the getDeviceSensorCommand API. |
| 103 |
link: https://developer.cisco.com/meraki/api-v1/#!get-device-sensor-command |
| 104 |
- name: Cisco Meraki documentation for sensor getDeviceSensorCommands |
| 105 |
description: Complete reference of the getDeviceSensorCommands API. |
| 106 |
link: https://developer.cisco.com/meraki/api-v1/#!get-device-sensor-commands |
| 107 |
notes: |
| 108 |
- SDK Method used are |
| 109 |
sensor.Sensor.get_device_sensor_command, |
| 110 |
sensor.Sensor.get_device_sensor_commands, |
| 111 |
- Paths used are |
| 112 |
get /devices/{serial}/sensor/commands, |
| 113 |
get /devices/{serial}/sensor/commands/{commandId}, |
| 114 |
""" |
| 115 |
|
| 116 |
EXAMPLES = r""" |
| 117 |
- name: Get all devices _sensor _commands |
| 118 |
cisco.meraki.devices_sensor_commands_info: |
| 119 |
meraki_api_key: "{{ meraki_api_key }}" |
| 120 |
meraki_base_url: "{{ meraki_base_url }}" |
| 121 |
meraki_single_request_timeout: "{{ meraki_single_request_timeout }}" |
| 122 |
meraki_certificate_path: "{{ meraki_certificate_path }}" |
| 123 |
meraki_requests_proxy: "{{ meraki_requests_proxy }}" |
| 124 |
meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}" |
| 125 |
meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}" |
| 126 |
meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}" |
| 127 |
meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}" |
| 128 |
meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}" |
| 129 |
meraki_maximum_retries: "{{ meraki_maximum_retries }}" |
| 130 |
meraki_output_log: "{{ meraki_output_log }}" |
| 131 |
meraki_log_file_prefix: "{{ meraki_log_file_prefix }}" |
| 132 |
meraki_log_path: "{{ meraki_log_path }}" |
| 133 |
meraki_print_console: "{{ meraki_print_console }}" |
| 134 |
meraki_suppress_logging: "{{ meraki_suppress_logging }}" |
| 135 |
meraki_simulate: "{{ meraki_simulate }}" |
| 136 |
meraki_be_geo_id: "{{ meraki_be_geo_id }}" |
| 137 |
meraki_caller: "{{ meraki_caller }}" |
| 138 |
meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}" |
| 139 |
meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}" |
| 140 |
operations: [] |
| 141 |
perPage: 0 |
| 142 |
startingAfter: string |
| 143 |
endingBefore: string |
| 144 |
sortOrder: string |
| 145 |
t0: string |
| 146 |
t1: string |
| 147 |
timespan: 0 |
| 148 |
serial: string |
| 149 |
total_pages: -1 |
| 150 |
direction: next |
| 151 |
register: result |
| 152 |
- name: Get devices _sensor _commands by id |
| 153 |
cisco.meraki.devices_sensor_commands_info: |
| 154 |
meraki_api_key: "{{ meraki_api_key }}" |
| 155 |
meraki_base_url: "{{ meraki_base_url }}" |
| 156 |
meraki_single_request_timeout: "{{ meraki_single_request_timeout }}" |
| 157 |
meraki_certificate_path: "{{ meraki_certificate_path }}" |
| 158 |
meraki_requests_proxy: "{{ meraki_requests_proxy }}" |
| 159 |
meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}" |
| 160 |
meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}" |
| 161 |
meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}" |
| 162 |
meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}" |
| 163 |
meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}" |
| 164 |
meraki_maximum_retries: "{{ meraki_maximum_retries }}" |
| 165 |
meraki_output_log: "{{ meraki_output_log }}" |
| 166 |
meraki_log_file_prefix: "{{ meraki_log_file_prefix }}" |
| 167 |
meraki_log_path: "{{ meraki_log_path }}" |
| 168 |
meraki_print_console: "{{ meraki_print_console }}" |
| 169 |
meraki_suppress_logging: "{{ meraki_suppress_logging }}" |
| 170 |
meraki_simulate: "{{ meraki_simulate }}" |
| 171 |
meraki_be_geo_id: "{{ meraki_be_geo_id }}" |
| 172 |
meraki_caller: "{{ meraki_caller }}" |
| 173 |
meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}" |
| 174 |
meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}" |
| 175 |
serial: string |
| 176 |
commandId: string |
| 177 |
register: result |
| 178 |
""" |
| 179 |
RETURN = r""" |
| 180 |
meraki_response: |
| 181 |
description: A dictionary or list with the response returned by the Cisco Meraki Python SDK |
| 182 |
returned: always |
| 183 |
type: dict |
| 184 |
sample: > |
| 185 |
{ |
| 186 |
"commandId": "string", |
| 187 |
"createdAt": "string", |
| 188 |
"completedAt": "string", |
| 189 |
"createdBy": { |
| 190 |
"adminId": "string", |
| 191 |
"name": "string", |
| 192 |
"email": "string" |
| 193 |
}, |
| 194 |
"operation": "string", |
| 195 |
"status": "string", |
| 196 |
"errors": [ |
| 197 |
"string" |
| 198 |
] |
| 199 |
} |
| 200 |
""" |