Skip to content

create_credential_locker

create_credential_locker(
    *,
    config_overrides: Optional[IoTManagedIntegrationsClientConfig] = None,
    name: Optional[CredentialLockerName] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[TagsMap] = None,
) -> CreateCredentialLockerResponse

Create a credential locker.

This operation will not trigger the creation of all the manufacturing resources.

Parameters:

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

    The name of the credential locker.

  • client_token (Optional[ClientToken], default: None ) –

    An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.

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

    A set of key/value pairs that are used to manage the credential locker.

Raises:

Source code in docs_src/capo_iot_managed_integrations/_services/io_t_managed_integrations.py
def create_credential_locker(
    self,
    *,
    config_overrides: Optional[IoTManagedIntegrationsClientConfig] = None,
    name: Optional[
        "capo_iot_managed_integrations.types.credential_locker_name.CredentialLockerName"
    ] = None,
    client_token: Optional[
        "capo_iot_managed_integrations.types.client_token.ClientToken"
    ] = None,
    tags: Optional["capo_iot_managed_integrations.types.tags_map.TagsMap"] = None,
) -> "capo_iot_managed_integrations.types.create_credential_locker_response.CreateCredentialLockerResponse":
    """<p>Create a credential locker.</p> <note> <p>This operation will not trigger the creation of all the manufacturing resources.</p> </note>

    Args:
        name: <p>The name of the credential locker.</p>
        client_token: <p>An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.</p>
        tags: <p>A set of key/value pairs that are used to manage the credential locker.</p>

    Raises:
        capo_iot_managed_integrations.errors.access_denied_exception.AccessDeniedException: <p>User is not authorized.</p>
        capo_iot_managed_integrations.errors.conflict_exception.ConflictException: <p>There is a conflict with the request.</p>
        capo_iot_managed_integrations.errors.internal_server_exception.InternalServerException: <p>Internal error from the service that indicates an unexpected error or that the service is unavailable.</p>
        capo_iot_managed_integrations.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded for this request.</p>
        capo_iot_managed_integrations.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is temporarily unavailable.</p>
        capo_iot_managed_integrations.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot_managed_integrations.errors.validation_exception.ValidationException: <p>A validation error occurred when performing the API request.</p>
        capo_iot_managed_integrations.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iot_managed_integrations.types.create_credential_locker_request.CreateCredentialLockerRequest]",
    ) -> OperationResponse[
        "capo_iot_managed_integrations.types.create_credential_locker_response.CreateCredentialLockerResponse"
    ]:
        import capo_iot_managed_integrations._operations.iot_managed_integrations.create_credential_locker

        output, http_response = (
            capo_iot_managed_integrations._operations.iot_managed_integrations.create_credential_locker.create_credential_locker(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_iot_managed_integrations.types.create_credential_locker_request.CreateCredentialLockerRequest",
    ) -> dict[str, Any]:
        import capo_iot_managed_integrations.types.create_credential_locker_request

        return capo_iot_managed_integrations.types.create_credential_locker_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateCredentialLocker", redact_input=_redact_input),
    )
    input_: capo_iot_managed_integrations.types.create_credential_locker_request.CreateCredentialLockerRequest = {}
    if name is not None:
        input_["name"] = name
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

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