Skip to content

create_provisioning_profile async

create_provisioning_profile(
    provisioning_type: ProvisioningType,
    *,
    config_overrides: Optional[AsyncIoTManagedIntegrationsClientConfig] = None,
    ca_certificate: Optional[CaCertificate] = None,
    claim_certificate: Optional[ClaimCertificate] = None,
    name: Optional[ProvisioningProfileName] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[TagsMap] = None,
) -> CreateProvisioningProfileResponse

Create a provisioning profile for executing device provisioning flows. The provisioning profile is a document that defines the set of resources and policies applied to a device during the provisioning process.

Parameters:

  • provisioning_type (ProvisioningType) –

    The type of provisioning workflow the device uses for onboarding to IoT managed integrations.

  • ca_certificate (Optional[CaCertificate], default: None ) –

    The body of the PEM-encoded certificate authority (CA) certificate.

  • claim_certificate (Optional[ClaimCertificate], default: None ) –

    The body of the PEM-encoded claim certificate. If a claim certificate is provided, it will be used for the provisioning profile. Otherwise, a claim certificate will be generated.

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

    The name of the provisioning profile.

  • 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 provisioning profile.

Raises:

Source code in docs_src/capo_iot_managed_integrations/_services/async_io_t_managed_integrations.py
async def create_provisioning_profile(
    self,
    provisioning_type: "capo_iot_managed_integrations.types.provisioning_type.ProvisioningType",
    *,
    config_overrides: Optional[AsyncIoTManagedIntegrationsClientConfig] = None,
    ca_certificate: Optional[
        "capo_iot_managed_integrations.types.ca_certificate.CaCertificate"
    ] = None,
    claim_certificate: Optional[
        "capo_iot_managed_integrations.types.claim_certificate.ClaimCertificate"
    ] = None,
    name: Optional[
        "capo_iot_managed_integrations.types.provisioning_profile_name.ProvisioningProfileName"
    ] = 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_provisioning_profile_response.CreateProvisioningProfileResponse":
    """<p>Create a provisioning profile for executing device provisioning flows. The provisioning profile is a document that defines the set of resources and policies applied to a device during the provisioning process.</p>

    Args:
        provisioning_type: <p>The type of provisioning workflow the device uses for onboarding to IoT managed integrations.</p>
        ca_certificate: <p>The body of the PEM-encoded certificate authority (CA) certificate.</p>
        claim_certificate: <p>The body of the PEM-encoded claim certificate. If a claim certificate is provided, it will be used for the provisioning profile. Otherwise, a claim certificate will be generated.</p>
        name: <p>The name of the provisioning profile.</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 provisioning profile.</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.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</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.unauthorized_exception.UnauthorizedException: <p>You are not authorized to perform this operation.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot_managed_integrations.types.create_provisioning_profile_request.CreateProvisioningProfileRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot_managed_integrations.types.create_provisioning_profile_response.CreateProvisioningProfileResponse"
    ]:
        import capo_iot_managed_integrations._operations.iot_managed_integrations.create_provisioning_profile

        (
            output,
            http_response,
        ) = await capo_iot_managed_integrations._operations.iot_managed_integrations.create_provisioning_profile.async_create_provisioning_profile(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

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

        return capo_iot_managed_integrations.types.create_provisioning_profile_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_iot_managed_integrations.types.create_provisioning_profile_response.CreateProvisioningProfileResponse",
    ) -> dict[str, Any]:
        import capo_iot_managed_integrations.types.create_provisioning_profile_response

        return capo_iot_managed_integrations.types.create_provisioning_profile_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateProvisioningProfile",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_iot_managed_integrations.types.create_provisioning_profile_request.CreateProvisioningProfileRequest = {
        "provisioning_type": provisioning_type
    }
    if ca_certificate is not None:
        input_["ca_certificate"] = ca_certificate
    if claim_certificate is not None:
        input_["claim_certificate"] = claim_certificate
    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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output