create_command
¶
create_command(
command_id: CommandId,
*,
config_overrides: Optional[IoTClientConfig] = None,
namespace: Optional[CommandNamespace] = None,
display_name: Optional[DisplayName] = None,
description: Optional[CommandDescription] = None,
payload: Optional[CommandPayload] = None,
payload_template: Optional[CommandPayloadTemplateString] = None,
preprocessor: Optional[CommandPreprocessor] = None,
mandatory_parameters: Optional[CommandParameterList] = None,
role_arn: Optional[RoleArn] = None,
tags: Optional[TagList] = None,
) -> CreateCommandResponse
Creates a command. A command contains reusable configurations that can be applied before they are sent to the devices.
Parameters:
-
command_id(CommandId) –A unique identifier for the command. We recommend using UUID. Alpha-numeric characters, hyphens, and underscores are valid for use here.
-
namespace(Optional[CommandNamespace], default:None) –The namespace of the command. The MQTT reserved topics and validations will be used for command executions according to the namespace setting.
-
display_name(Optional[DisplayName], default:None) –The user-friendly name in the console for the command. This name doesn't have to be unique. You can update the user-friendly name after you define it.
-
description(Optional[CommandDescription], default:None) –A short text decription of the command.
-
payload(Optional[CommandPayload], default:None) –The payload object for the static command.
You can upload a static payload file from your local storage that contains the instructions for the device to process. The payload file can use any format. To make sure that the device correctly interprets the payload, we recommend you to specify the payload content type.
-
payload_template(Optional[CommandPayloadTemplateString], default:None) –The payload template for the dynamic command.
This parameter is required for dynamic commands where the command execution placeholders are supplied either from
mandatoryParametersor whenStartCommandExecutionis invoked. -
preprocessor(Optional[CommandPreprocessor], default:None) –Configuration that determines how
payloadTemplateis processed to generate command execution payload.This parameter is required for dynamic commands, along with
payloadTemplate, andmandatoryParameters. -
mandatory_parameters(Optional[CommandParameterList], default:None) –A list of parameters that are used by
StartCommandExecutionAPI for execution payload generation. -
role_arn(Optional[RoleArn], default:None) –The IAM role that you must provide when using the
AWS-IoT-FleetWisenamespace. The role grants IoT Device Management the permission to access IoT FleetWise resources for generating the payload for the command. This field is not supported when you use theAWS-IoTnamespace. -
tags(Optional[TagList], default:None) –Name-value pairs that are used as metadata to manage a command.
Raises:
-
ConflictException–The request conflicts with the current state of the resource.
-
InternalServerException–Internal error from the service that indicates an unexpected error or that the service is unavailable.
-
ServiceQuotaExceededException–Service quota has been exceeded.
-
ThrottlingException–The rate exceeds the limit.
-
ValidationException–The request is not valid.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_iot/_services/io_t.py
2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 | |