Skip to content

create_gateway

create_gateway(
    gateway_name: GatewayName,
    gateway_platform: GatewayPlatform,
    *,
    config_overrides: Optional[IoTSiteWiseClientConfig] = None,
    gateway_version: Optional[GatewayVersion] = None,
    tags: Optional[TagMap] = None,
) -> CreateGatewayResponse

Creates a gateway, which is a virtual or edge device that delivers industrial data streams from local servers to IoT SiteWise. For more information, see Ingesting data using a gateway in the IoT SiteWise User Guide.

Parameters:

  • gateway_name (GatewayName) –

    A unique name for the gateway.

  • gateway_platform (GatewayPlatform) –

    The gateway's platform. You can only specify one platform in a gateway.

  • gateway_version (Optional[GatewayVersion], default: None ) –

    The version of the gateway to create. Specify 3 to create an MQTT-enabled, V3 gateway and 2 to create a Classic streams, V2 gateway. If not specified, the default is 2 (Classic streams, V2 gateway).

    When creating a V3 gateway (gatewayVersion=3) with the GreengrassV2 platform, you must also specify the coreDeviceOperatingSystem parameter.

    We recommend creating an MQTT-enabled gateway for self-hosted gateways and Siemens Industrial Edge gateways. For more information on gateway versions, see Use Amazon Web Services IoT SiteWise Edge Edge gateways.

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

    A list of key-value pairs that contain metadata for the gateway. For more information, see Tagging your IoT SiteWise resources in the IoT SiteWise User Guide.

Raises:

  • InternalFailureException –

    IoT SiteWise can't process your request right now. Try again later.

  • InvalidRequestException –

    The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters. Check your request and try again.

  • LimitExceededException –

    You've reached the quota for a resource. For example, this can occur if you're trying to associate more than the allowed number of child assets or attempting to create more than the allowed number of properties for an asset model.

    For more information, see Quotas in the IoT SiteWise User Guide.

  • ResourceAlreadyExistsException –

    The resource already exists.

  • ThrottlingException –

    Your request exceeded a rate limit. For example, you might have exceeded the number of IoT SiteWise assets that can be created per second, the allowed number of messages per second, and so on.

    For more information, see Quotas in the IoT SiteWise User Guide.

  • UnknownServiceError –

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

Source code in docs_src/capo_iotsitewise/_services/io_t_site_wise.py
def create_gateway(
    self,
    gateway_name: "capo_iotsitewise.types.gateway_name.GatewayName",
    gateway_platform: "capo_iotsitewise.types.gateway_platform.GatewayPlatform",
    *,
    config_overrides: Optional[IoTSiteWiseClientConfig] = None,
    gateway_version: Optional[
        "capo_iotsitewise.types.gateway_version.GatewayVersion"
    ] = None,
    tags: Optional["capo_iotsitewise.types.tag_map.TagMap"] = None,
) -> "capo_iotsitewise.types.create_gateway_response.CreateGatewayResponse":
    """<p>Creates a gateway, which is a virtual or edge device that delivers industrial data streams from local servers to IoT SiteWise. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/gateway-connector.html">Ingesting data using a gateway</a> in the <i>IoT SiteWise User Guide</i>.</p>

    Args:
        gateway_name: <p>A unique name for the gateway.</p>
        gateway_platform: <p>The gateway's platform. You can only specify one platform in a gateway.</p>
        gateway_version: <p>The version of the gateway to create. Specify <code>3</code> to create an MQTT-enabled, V3 gateway and <code>2</code> to create a Classic streams, V2 gateway. If not specified, the default is <code>2</code> (Classic streams, V2 gateway).</p> <note> <p>When creating a V3 gateway (<code>gatewayVersion=3</code>) with the <code>GreengrassV2</code> platform, you must also specify the <code>coreDeviceOperatingSystem</code> parameter.</p> </note> <p> We recommend creating an MQTT-enabled gateway for self-hosted gateways and Siemens Industrial Edge gateways. For more information on gateway versions, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/gateways.html">Use Amazon Web Services IoT SiteWise Edge Edge gateways</a>.</p>
        tags: <p>A list of key-value pairs that contain metadata for the gateway. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>

    Raises:
        capo_iotsitewise.errors.internal_failure_exception.InternalFailureException: <p>IoT SiteWise can't process your request right now. Try again later.</p>
        capo_iotsitewise.errors.invalid_request_exception.InvalidRequestException: <p>The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters. Check your request and try again.</p>
        capo_iotsitewise.errors.limit_exceeded_exception.LimitExceededException: <p>You've reached the quota for a resource. For example, this can occur if you're trying to associate more than the allowed number of child assets or attempting to create more than the allowed number of properties for an asset model.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html">Quotas</a> in the <i>IoT SiteWise User Guide</i>.</p>
        capo_iotsitewise.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>The resource already exists.</p>
        capo_iotsitewise.errors.throttling_exception.ThrottlingException: <p>Your request exceeded a rate limit. For example, you might have exceeded the number of IoT SiteWise assets that can be created per second, the allowed number of messages per second, and so on.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html">Quotas</a> in the <i>IoT SiteWise User Guide</i>.</p>
        capo_iotsitewise.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iotsitewise.types.create_gateway_request.CreateGatewayRequest]",
    ) -> OperationResponse[
        "capo_iotsitewise.types.create_gateway_response.CreateGatewayResponse"
    ]:
        import capo_iotsitewise._operations.aws_io_t_site_wise.create_gateway

        output, http_response = (
            capo_iotsitewise._operations.aws_io_t_site_wise.create_gateway.create_gateway(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateGateway")
    )
    input_: capo_iotsitewise.types.create_gateway_request.CreateGatewayRequest = {
        "gateway_name": gateway_name,
        "gateway_platform": gateway_platform,
    }
    if gateway_version is not None:
        input_["gateway_version"] = gateway_version
    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