Skip to content

create_device_fleet async

create_device_fleet(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    device_fleet_name: Optional[EntityName] = None,
    role_arn: Optional[RoleArn] = None,
    description: Optional[DeviceFleetDescription] = None,
    output_config: Optional[EdgeOutputConfig] = None,
    tags: Optional[TagList] = None,
    enable_iot_role_alias: Optional[EnableIotRoleAlias] = None,
) -> None

Creates a device fleet.

Parameters:

  • device_fleet_name (Optional[EntityName], default: None ) –

    The name of the fleet that the device belongs to.

  • role_arn (Optional[RoleArn], default: None ) –

    The Amazon Resource Name (ARN) that has access to Amazon Web Services Internet of Things (IoT).

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

    A description of the fleet.

  • output_config (Optional[EdgeOutputConfig], default: None ) –

    The output configuration for storing sample data collected by the fleet.

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

    Creates tags for the specified fleet.

  • enable_iot_role_alias (Optional[EnableIotRoleAlias], default: None ) –

    Whether to create an Amazon Web Services IoT Role Alias during device fleet creation. The name of the role alias generated will match this pattern: "SageMakerEdge-{DeviceFleetName}".

    For example, if your device fleet is called "demo-fleet", the name of the role alias will be "SageMakerEdge-demo-fleet".

Raises:

  • ResourceInUse –

    Resource being accessed is in use.

  • ResourceLimitExceeded –

    You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def create_device_fleet(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    device_fleet_name: Optional[
        "capo_sagemaker.types.entity_name.EntityName"
    ] = None,
    role_arn: Optional["capo_sagemaker.types.role_arn.RoleArn"] = None,
    description: Optional[
        "capo_sagemaker.types.device_fleet_description.DeviceFleetDescription"
    ] = None,
    output_config: Optional[
        "capo_sagemaker.types.edge_output_config.EdgeOutputConfig"
    ] = None,
    tags: Optional["capo_sagemaker.types.tag_list.TagList"] = None,
    enable_iot_role_alias: Optional[
        "capo_sagemaker.types.enable_iot_role_alias.EnableIotRoleAlias"
    ] = None,
) -> None:
    """<p>Creates a device fleet.</p>

    Args:
        device_fleet_name: <p>The name of the fleet that the device belongs to.</p>
        role_arn: <p>The Amazon Resource Name (ARN) that has access to Amazon Web Services Internet of Things (IoT).</p>
        description: <p>A description of the fleet.</p>
        output_config: <p>The output configuration for storing sample data collected by the fleet.</p>
        tags: <p>Creates tags for the specified fleet.</p>
        enable_iot_role_alias: <p>Whether to create an Amazon Web Services IoT Role Alias during device fleet creation. The name of the role alias generated will match this pattern: "SageMakerEdge-{DeviceFleetName}".</p> <p>For example, if your device fleet is called "demo-fleet", the name of the role alias will be "SageMakerEdge-demo-fleet".</p>

    Raises:
        capo_sagemaker.errors.resource_in_use.ResourceInUse: <p>Resource being accessed is in use.</p>
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.create_device_fleet_request.CreateDeviceFleetRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_sagemaker._operations.sage_maker.create_device_fleet

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.create_device_fleet.async_create_device_fleet(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDeviceFleet")
    )
    input_: capo_sagemaker.types.create_device_fleet_request.CreateDeviceFleetRequest = {}
    if device_fleet_name is not None:
        input_["device_fleet_name"] = device_fleet_name
    if role_arn is not None:
        input_["role_arn"] = role_arn
    if description is not None:
        input_["description"] = description
    if output_config is not None:
        input_["output_config"] = output_config
    if tags is not None:
        input_["tags"] = tags
    if enable_iot_role_alias is not None:
        input_["enable_iot_role_alias"] = enable_iot_role_alias

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