IoTSiteWise / Client / create_portal

create_portal#

IoTSiteWise.Client.create_portal(**kwargs)#

Creates a portal, which can contain projects and dashboards. IoT SiteWise Monitor uses IAM Identity Center or IAM to authenticate portal users and manage user permissions.

Note

Before you can sign in to a new portal, you must add at least one identity to that portal. For more information, see Adding or removing portal administrators in the IoT SiteWise User Guide.

See also: AWS API Documentation

Request Syntax

response = client.create_portal(
    portalName='string',
    portalDescription='string',
    portalContactEmail='string',
    clientToken='string',
    portalLogoImageFile={
        'data': b'bytes',
        'type': 'PNG'
    },
    roleArn='string',
    tags={
        'string': 'string'
    },
    portalAuthMode='IAM'|'SSO',
    notificationSenderEmail='string',
    alarms={
        'alarmRoleArn': 'string',
        'notificationLambdaArn': 'string'
    },
    portalType='SITEWISE_PORTAL_V1'|'SITEWISE_PORTAL_V2',
    portalTypeConfiguration={
        'string': {
            'portalTools': [
                'string',
            ]
        }
    }
)
Parameters:
  • portalName (string) –

    [REQUIRED]

    A friendly name for the portal.

  • portalDescription (string) – A description for the portal.

  • portalContactEmail (string) –

    [REQUIRED]

    The Amazon Web Services administrator’s contact email address.

  • clientToken (string) –

    A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don’t reuse this client token if a new idempotent request is required.

    This field is autopopulated if not provided.

  • portalLogoImageFile (dict) –

    A logo image to display in the portal. Upload a square, high-resolution image. The image is displayed on a dark background.

    • data (bytes) – [REQUIRED]

      The image file contents, represented as a base64-encoded string. The file size must be less than 1 MB.

    • type (string) – [REQUIRED]

      The file type of the image.

  • roleArn (string) –

    [REQUIRED]

    The ARN of a service role that allows the portal’s users to access your IoT SiteWise resources on your behalf. For more information, see Using service roles for IoT SiteWise Monitor in the IoT SiteWise User Guide.

  • tags (dict) –

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

    • (string) –

      • (string) –

  • portalAuthMode (string) –

    The service to use to authenticate users to the portal. Choose from the following options:

    • SSO – The portal uses IAM Identity Center to authenticate users and manage user permissions. Before you can create a portal that uses IAM Identity Center, you must enable IAM Identity Center. For more information, see Enabling IAM Identity Center in the IoT SiteWise User Guide. This option is only available in Amazon Web Services Regions other than the China Regions.

    • IAM – The portal uses Identity and Access Management to authenticate users and manage user permissions.

    You can’t change this value after you create a portal.

    Default: SSO

  • notificationSenderEmail (string) –

    The email address that sends alarm notifications.

    Warning

    If you use the IoT Events managed Lambda function to manage your emails, you must verify the sender email address in Amazon SES.

  • alarms (dict) –

    Contains the configuration information of an alarm created in an IoT SiteWise Monitor portal. You can use the alarm to monitor an asset property and get notified when the asset property value is outside a specified range. For more information, see Monitoring with alarms in the IoT SiteWise Application Guide.

    • alarmRoleArn (string) – [REQUIRED]

      The ARN of the IAM role that allows the alarm to perform actions and access Amazon Web Services resources and services, such as IoT Events.

    • notificationLambdaArn (string) –

      The ARN of the Lambda function that manages alarm notifications. For more information, see Managing alarm notifications in the IoT Events Developer Guide.

  • portalType (string) – Define the type of portal. The value for IoT SiteWise Monitor (Classic) is SITEWISE_PORTAL_V1. The value for IoT SiteWise Monitor (AI-aware) is SITEWISE_PORTAL_V2.

  • portalTypeConfiguration (dict) –

    The configuration entry associated with the specific portal type. The value for IoT SiteWise Monitor (Classic) is SITEWISE_PORTAL_V1. The value for IoT SiteWise Monitor (AI-aware) is SITEWISE_PORTAL_V2.

    • (string) –

      • (dict) –

        The configuration entry associated with the specific portal type. The portalTypeConfiguration is a map of the portalTypeKey to the PortalTypeEntry.

        • portalTools (list) –

          The array of tools associated with the specified portal type. The possible values are ASSISTANT and DASHBOARD.

          • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'portalId': 'string',
    'portalArn': 'string',
    'portalStartUrl': 'string',
    'portalStatus': {
        'state': 'CREATING'|'PENDING'|'UPDATING'|'DELETING'|'ACTIVE'|'FAILED',
        'error': {
            'code': 'INTERNAL_FAILURE'|'VALIDATION_ERROR'|'LIMIT_EXCEEDED',
            'message': 'string'
        }
    },
    'ssoApplicationId': 'string'
}

Response Structure

  • (dict) –

    • portalId (string) –

      The ID of the created portal.

    • portalArn (string) –

      The ARN of the portal, which has the following format.

      arn:${Partition}:iotsitewise:${Region}:${Account}:portal/${PortalId}

    • portalStartUrl (string) –

      The URL for the IoT SiteWise Monitor portal. You can use this URL to access portals that use IAM Identity Center for authentication. For portals that use IAM for authentication, you must use the IoT SiteWise console to get a URL that you can use to access the portal.

    • portalStatus (dict) –

      The status of the portal, which contains a state ( CREATING after successfully calling this operation) and any error message.

      • state (string) –

        The current state of the portal.

      • error (dict) –

        Contains associated error information, if any.

        • code (string) –

          The error code.

        • message (string) –

          The error message.

    • ssoApplicationId (string) –

      The associated IAM Identity Center application ID, if the portal uses IAM Identity Center.

Exceptions

  • IoTSiteWise.Client.exceptions.InvalidRequestException

  • IoTSiteWise.Client.exceptions.ResourceNotFoundException

  • IoTSiteWise.Client.exceptions.InternalFailureException

  • IoTSiteWise.Client.exceptions.ThrottlingException

  • IoTSiteWise.Client.exceptions.LimitExceededException