Skip to content

create_wireless_device

create_wireless_device(
    type: WirelessDeviceType,
    destination_name: DestinationName,
    *,
    config_overrides: Optional[IoTWirelessClientConfig] = None,
    name: Optional[WirelessDeviceName] = None,
    description: Optional[Description] = None,
    client_request_token: Optional[ClientRequestToken] = None,
    lo_ra_wan: Optional[LoRaWANDevice] = None,
    tags: Optional[TagList] = None,
    positioning: Optional[PositioningConfigStatus] = None,
    sidewalk: Optional[SidewalkCreateWirelessDevice] = None,
) -> CreateWirelessDeviceResponse

Provisions a wireless device.

Parameters:

  • type (WirelessDeviceType) –

    The wireless device type.

  • name (Optional[WirelessDeviceName], default: None ) –

    The name of the new resource.

    The following special characters aren't accepted: <>^#~$

  • description (Optional[Description], default: None ) –

    The description of the new resource.

  • destination_name (DestinationName) –

    The name of the destination to assign to the new wireless device.

  • client_request_token (Optional[ClientRequestToken], default: None ) –

    Each resource must have a unique client request token. The client token is used to implement idempotency. It ensures that the request completes no more than one time. If you retry a request with the same token and the same parameters, the request will complete successfully. However, if you try to create a new resource using the same token but different parameters, an HTTP 409 conflict occurs. If you omit this value, AWS SDKs will automatically generate a unique client request. For more information about idempotency, see Ensuring idempotency in Amazon EC2 API requests.

  • lo_ra_wan (Optional[LoRaWANDevice], default: None ) –

    The device configuration information to use to create the wireless device.

  • tags (Optional[TagList], default: None ) –

    The tags to attach to the new wireless device. Tags are metadata that you can use to manage a resource.

  • positioning (Optional[PositioningConfigStatus], default: None ) –

    The integration status of the Device Location feature for LoRaWAN and Sidewalk devices.

  • sidewalk (Optional[SidewalkCreateWirelessDevice], default: None ) –

    The device configuration information to use to create the Sidewalk device.

Raises:

Source code in docs_src/capo_iot_wireless/_services/io_t_wireless.py
def create_wireless_device(
    self,
    type: "capo_iot_wireless.types.wireless_device_type.WirelessDeviceType",
    destination_name: "capo_iot_wireless.types.destination_name.DestinationName",
    *,
    config_overrides: Optional[IoTWirelessClientConfig] = None,
    name: Optional[
        "capo_iot_wireless.types.wireless_device_name.WirelessDeviceName"
    ] = None,
    description: Optional["capo_iot_wireless.types.description.Description"] = None,
    client_request_token: Optional[
        "capo_iot_wireless.types.client_request_token.ClientRequestToken"
    ] = None,
    lo_ra_wan: Optional[
        "capo_iot_wireless.types.lo_ra_wan_device.LoRaWANDevice"
    ] = None,
    tags: Optional["capo_iot_wireless.types.tag_list.TagList"] = None,
    positioning: Optional[
        "capo_iot_wireless.types.positioning_config_status.PositioningConfigStatus"
    ] = None,
    sidewalk: Optional[
        "capo_iot_wireless.types.sidewalk_create_wireless_device.SidewalkCreateWirelessDevice"
    ] = None,
) -> "capo_iot_wireless.types.create_wireless_device_response.CreateWirelessDeviceResponse":
    """<p>Provisions a wireless device.</p>

    Args:
        type: <p>The wireless device type.</p>
        name: <p>The name of the new resource.</p> <note> <p>The following special characters aren't accepted: <code><>^#~$</code> </p> </note>
        description: <p>The description of the new resource.</p>
        destination_name: <p>The name of the destination to assign to the new wireless device.</p>
        client_request_token: <p>Each resource must have a unique client request token. The client token is used to implement idempotency. It ensures that the request completes no more than one time. If you retry a request with the same token and the same parameters, the request will complete successfully. However, if you try to create a new resource using the same token but different parameters, an HTTP 409 conflict occurs. If you omit this value, AWS SDKs will automatically generate a unique client request. For more information about idempotency, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency in Amazon EC2 API requests</a>.</p>
        lo_ra_wan: <p>The device configuration information to use to create the wireless device.</p>
        tags: <p>The tags to attach to the new wireless device. Tags are metadata that you can use to manage a resource.</p>
        positioning: <p>The integration status of the Device Location feature for LoRaWAN and Sidewalk devices.</p>
        sidewalk: <p>The device configuration information to use to create the Sidewalk device.</p>

    Raises:
        capo_iot_wireless.errors.access_denied_exception.AccessDeniedException: <p>User does not have permission to perform this action.</p>
        capo_iot_wireless.errors.conflict_exception.ConflictException: <p>Adding, updating, or deleting the resource can cause an inconsistent state.</p>
        capo_iot_wireless.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred while processing a request.</p>
        capo_iot_wireless.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource does not exist.</p>
        capo_iot_wireless.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded the allowed API request rate.</p>
        capo_iot_wireless.errors.validation_exception.ValidationException: <p>The input did not meet the specified constraints.</p>
        capo_iot_wireless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iot_wireless.types.create_wireless_device_request.CreateWirelessDeviceRequest]",
    ) -> OperationResponse[
        "capo_iot_wireless.types.create_wireless_device_response.CreateWirelessDeviceResponse"
    ]:
        import capo_iot_wireless._operations.iotwireless.create_wireless_device

        output, http_response = (
            capo_iot_wireless._operations.iotwireless.create_wireless_device.create_wireless_device(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateWirelessDevice")
    )
    input_: capo_iot_wireless.types.create_wireless_device_request.CreateWirelessDeviceRequest = {
        "type": type,
        "destination_name": destination_name,
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    if lo_ra_wan is not None:
        input_["lo_ra_wan"] = lo_ra_wan
    if tags is not None:
        input_["tags"] = tags
    if positioning is not None:
        input_["positioning"] = positioning
    if sidewalk is not None:
        input_["sidewalk"] = sidewalk

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output