Skip to content

update_device async

update_device(
    global_network_id: GlobalNetworkId,
    device_id: DeviceId,
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    aws_location: Optional[AWSLocation] = None,
    description: Optional[ConstrainedString] = None,
    type: Optional[ConstrainedString] = None,
    vendor: Optional[ConstrainedString] = None,
    model: Optional[ConstrainedString] = None,
    serial_number: Optional[ConstrainedString] = None,
    location: Optional[Location] = None,
    site_id: Optional[SiteId] = None,
) -> UpdateDeviceResponse

Updates the details for an existing device. To remove information for any of the parameters, specify an empty string.

Parameters:

  • global_network_id (GlobalNetworkId) –

    The ID of the global network.

  • device_id (DeviceId) –

    The ID of the device.

  • aws_location (Optional[AWSLocation], default: None ) –

    The Amazon Web Services location of the device, if applicable. For an on-premises device, you can omit this parameter.

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

    A description of the device.

    Constraints: Maximum length of 256 characters.

  • type (Optional[ConstrainedString], default: None ) –

    The type of the device.

  • vendor (Optional[ConstrainedString], default: None ) –

    The vendor of the device.

    Constraints: Maximum length of 128 characters.

  • model (Optional[ConstrainedString], default: None ) –

    The model of the device.

    Constraints: Maximum length of 128 characters.

  • serial_number (Optional[ConstrainedString], default: None ) –

    The serial number of the device.

    Constraints: Maximum length of 128 characters.

  • site_id (Optional[SiteId], default: None ) –

    The ID of the site.

Raises:

Source code in docs_src/capo_networkmanager/_services/async_network_manager.py
async def update_device(
    self,
    global_network_id: "capo_networkmanager.types.global_network_id.GlobalNetworkId",
    device_id: "capo_networkmanager.types.device_id.DeviceId",
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    aws_location: Optional[
        "capo_networkmanager.types.aws_location.AWSLocation"
    ] = None,
    description: Optional[
        "capo_networkmanager.types.constrained_string.ConstrainedString"
    ] = None,
    type: Optional[
        "capo_networkmanager.types.constrained_string.ConstrainedString"
    ] = None,
    vendor: Optional[
        "capo_networkmanager.types.constrained_string.ConstrainedString"
    ] = None,
    model: Optional[
        "capo_networkmanager.types.constrained_string.ConstrainedString"
    ] = None,
    serial_number: Optional[
        "capo_networkmanager.types.constrained_string.ConstrainedString"
    ] = None,
    location: Optional["capo_networkmanager.types.location.Location"] = None,
    site_id: Optional["capo_networkmanager.types.site_id.SiteId"] = None,
) -> "capo_networkmanager.types.update_device_response.UpdateDeviceResponse":
    """<p>Updates the details for an existing device. To remove information for any of the parameters, specify an empty string.</p>

    Args:
        global_network_id: <p>The ID of the global network.</p>
        device_id: <p>The ID of the device.</p>
        aws_location: <p>The Amazon Web Services location of the device, if applicable. For an on-premises device, you can omit this parameter.</p>
        description: <p>A description of the device.</p> <p>Constraints: Maximum length of 256 characters.</p>
        type: <p>The type of the device.</p>
        vendor: <p>The vendor of the device.</p> <p>Constraints: Maximum length of 128 characters.</p>
        model: <p>The model of the device.</p> <p>Constraints: Maximum length of 128 characters.</p>
        serial_number: <p>The serial number of the device.</p> <p>Constraints: Maximum length of 128 characters.</p>
        site_id: <p>The ID of the site.</p>

    Raises:
        capo_networkmanager.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_networkmanager.errors.conflict_exception.ConflictException: <p>There was a conflict processing the request. Updating or deleting the resource can cause an inconsistent state.</p>
        capo_networkmanager.errors.internal_server_exception.InternalServerException: <p>The request has failed due to an internal error.</p>
        capo_networkmanager.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found.</p>
        capo_networkmanager.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_networkmanager.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints.</p>
        capo_networkmanager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_networkmanager.types.update_device_request.UpdateDeviceRequest]",
    ) -> AsyncOperationResponse[
        "capo_networkmanager.types.update_device_response.UpdateDeviceResponse"
    ]:
        import capo_networkmanager._operations.network_manager.update_device

        (
            output,
            http_response,
        ) = await capo_networkmanager._operations.network_manager.update_device.async_update_device(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_networkmanager.types.update_device_request.UpdateDeviceRequest",
    ) -> dict[str, Any]:
        import capo_networkmanager.types.update_device_request

        return capo_networkmanager.types.update_device_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_networkmanager.types.update_device_response.UpdateDeviceResponse",
    ) -> dict[str, Any]:
        import capo_networkmanager.types.update_device_response

        return capo_networkmanager.types.update_device_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateDevice", redact_input=_redact_input, redact_output=_redact_output
        ),
    )
    input_: capo_networkmanager.types.update_device_request.UpdateDeviceRequest = {
        "global_network_id": global_network_id,
        "device_id": device_id,
    }
    if aws_location is not None:
        input_["aws_location"] = aws_location
    if description is not None:
        input_["description"] = description
    if type is not None:
        input_["type"] = type
    if vendor is not None:
        input_["vendor"] = vendor
    if model is not None:
        input_["model"] = model
    if serial_number is not None:
        input_["serial_number"] = serial_number
    if location is not None:
        input_["location"] = location
    if site_id is not None:
        input_["site_id"] = site_id

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output