2020/08/24 - AWS IoT SiteWise - 6 updated api methods
Changes Add traversalDirection to ListAssociatedAssetsRequest and add portal status to ListPortalsResponse
{'portalStatus': {'error': {'code': {'LIMIT_EXCEEDED', 'VALIDATION_ERROR'}}}}
Creates a portal, which can contain projects and dashboards. Before you can create a portal, you must enable AWS Single Sign-On. AWS IoT SiteWise Monitor uses AWS SSO to manage user permissions. For more information, see Enabling AWS SSO in the AWS IoT SiteWise User Guide .
Note
Before you can sign in to a new portal, you must add at least one AWS SSO user or group to that portal. For more information, see Adding or removing portal administrators in the AWS IoT SiteWise User Guide .
See also: AWS API Documentation
Request Syntax
client.create_portal( portalName='string', portalDescription='string', portalContactEmail='string', clientToken='string', portalLogoImageFile={ 'data': b'bytes', 'type': 'PNG' }, roleArn='string', tags={ 'string': 'string' } )
string
[REQUIRED]
A friendly name for the portal.
string
A description for the portal.
string
[REQUIRED]
The AWS administrator's contact email address.
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.
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.
string
[REQUIRED]
The ARN of a service role that allows the portal's users to access your AWS IoT SiteWise resources on your behalf. For more information, see Using service roles for AWS IoT SiteWise Monitor in the AWS IoT SiteWise User Guide .
dict
A list of key-value pairs that contain metadata for the portal. For more information, see Tagging your AWS IoT SiteWise resources in the AWS IoT SiteWise User Guide .
(string) --
(string) --
dict
Response Syntax
{ 'portalId': 'string', 'portalArn': 'string', 'portalStartUrl': 'string', 'portalStatus': { 'state': 'CREATING'|'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 public URL for the AWS IoT SiteWise Monitor 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 AWS SSO application Id.
{'portalStatus': {'error': {'code': {'LIMIT_EXCEEDED', 'VALIDATION_ERROR'}}}}
Deletes a portal from AWS IoT SiteWise Monitor.
See also: AWS API Documentation
Request Syntax
client.delete_portal( portalId='string', clientToken='string' )
string
[REQUIRED]
The ID of the portal to delete.
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.
dict
Response Syntax
{ 'portalStatus': { 'state': 'CREATING'|'UPDATING'|'DELETING'|'ACTIVE'|'FAILED', 'error': { 'code': 'INTERNAL_FAILURE'|'VALIDATION_ERROR'|'LIMIT_EXCEEDED', 'message': 'string' } } }
Response Structure
(dict) --
portalStatus (dict) --
The status of the portal, which contains a state (DELETING 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.
{'portalStatus': {'error': {'code': {'LIMIT_EXCEEDED', 'VALIDATION_ERROR'}}}}
Retrieves information about a portal.
See also: AWS API Documentation
Request Syntax
client.describe_portal( portalId='string' )
string
[REQUIRED]
The ID of the portal.
dict
Response Syntax
{ 'portalId': 'string', 'portalArn': 'string', 'portalName': 'string', 'portalDescription': 'string', 'portalClientId': 'string', 'portalStartUrl': 'string', 'portalContactEmail': 'string', 'portalStatus': { 'state': 'CREATING'|'UPDATING'|'DELETING'|'ACTIVE'|'FAILED', 'error': { 'code': 'INTERNAL_FAILURE'|'VALIDATION_ERROR'|'LIMIT_EXCEEDED', 'message': 'string' } }, 'portalCreationDate': datetime(2015, 1, 1), 'portalLastUpdateDate': datetime(2015, 1, 1), 'portalLogoImageLocation': { 'id': 'string', 'url': 'string' }, 'roleArn': 'string' }
Response Structure
(dict) --
portalId (string) --
The ID of the portal.
portalArn (string) --
The ARN of the portal, which has the following format.
arn:${Partition}:iotsitewise:${Region}:${Account}:portal/${PortalId}
portalName (string) --
The name of the portal.
portalDescription (string) --
The portal's description.
portalClientId (string) --
The AWS SSO application generated client ID (used with AWS SSO APIs).
portalStartUrl (string) --
The public root URL for the AWS IoT AWS IoT SiteWise Monitor application portal.
portalContactEmail (string) --
The AWS administrator's contact email address.
portalStatus (dict) --
The current status of the portal, which contains a state 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.
portalCreationDate (datetime) --
The date the portal was created, in Unix epoch time.
portalLastUpdateDate (datetime) --
The date the portal was last updated, in Unix epoch time.
portalLogoImageLocation (dict) --
The portal's logo image, which is available at a URL.
id (string) --
The ID of the image.
url (string) --
The URL where the image is available. The URL is valid for 15 minutes so that you can view and download the image
roleArn (string) --
The ARN of the service role that allows the portal's users to access your AWS IoT SiteWise resources on your behalf. For more information, see Using service roles for AWS IoT SiteWise Monitor in the AWS IoT SiteWise User Guide .
{'traversalDirection': 'PARENT | CHILD'}
Retrieves a paginated list of associated assets.
You can use this operation to do the following:
List child assets associated to a parent asset by a hierarchy that you specify.
List an asset's parent asset.
See also: AWS API Documentation
Request Syntax
client.list_associated_assets( assetId='string', hierarchyId='string', traversalDirection='PARENT'|'CHILD', nextToken='string', maxResults=123 )
string
[REQUIRED]
The ID of the asset to query.
string
The ID of the hierarchy by which child assets are associated to the asset. To find a hierarchy ID, use the DescribeAsset or DescribeAssetModel operations. This parameter is required if you choose CHILD for traversalDirection .
For more information, see Asset hierarchies in the AWS IoT SiteWise User Guide .
string
The direction to list associated assets. Choose one of the following options:
CHILD – The list includes all child assets associated to the asset. The hierarchyId parameter is required if you choose CHILD .
PARENT – The list includes the asset's parent asset.
Default: CHILD
string
The token to be used for the next set of paginated results.
integer
The maximum number of results to be returned per paginated request.
Default: 50
dict
Response Syntax
{ 'assetSummaries': [ { 'id': 'string', 'arn': 'string', 'name': 'string', 'assetModelId': 'string', 'creationDate': datetime(2015, 1, 1), 'lastUpdateDate': datetime(2015, 1, 1), 'status': { 'state': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'FAILED', 'error': { 'code': 'VALIDATION_ERROR'|'INTERNAL_FAILURE', 'message': 'string' } }, 'hierarchies': [ { 'id': 'string', 'name': 'string' }, ] }, ], 'nextToken': 'string' }
Response Structure
(dict) --
assetSummaries (list) --
A list that summarizes the associated assets.
(dict) --
Contains a summary of an associated asset.
id (string) --
The ID of the asset.
arn (string) --
The ARN of the asset, which has the following format.
arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId}
name (string) --
The name of the asset.
assetModelId (string) --
The ID of the asset model used to create the asset.
creationDate (datetime) --
The date the asset was created, in Unix epoch time.
lastUpdateDate (datetime) --
The date the asset was last updated, in Unix epoch time.
status (dict) --
The current status of the asset.
state (string) --
The current status of the asset.
error (dict) --
Contains associated error information, if any.
code (string) --
The error code.
message (string) --
The error message.
hierarchies (list) --
A list of asset hierarchies that each contain a hierarchyId . A hierarchy specifies allowed parent/child asset relationships.
(dict) --
Describes an asset hierarchy that contains a hierarchy's name and ID.
id (string) --
The ID of the hierarchy. This ID is a hierarchyId .
name (string) --
The hierarchy name provided in the CreateAssetModel or UpdateAssetModel API.
nextToken (string) --
The token for the next set of results, or null if there are no additional results.
{'portalSummaries': {'status': {'error': {'code': 'INTERNAL_FAILURE | ' 'VALIDATION_ERROR | ' 'LIMIT_EXCEEDED', 'message': 'string'}, 'state': 'CREATING | UPDATING | DELETING | ' 'ACTIVE | FAILED'}}}
Retrieves a paginated list of AWS IoT SiteWise Monitor portals.
See also: AWS API Documentation
Request Syntax
client.list_portals( nextToken='string', maxResults=123 )
string
The token to be used for the next set of paginated results.
integer
The maximum number of results to be returned per paginated request.
Default: 50
dict
Response Syntax
{ 'portalSummaries': [ { 'id': 'string', 'name': 'string', 'description': 'string', 'startUrl': 'string', 'creationDate': datetime(2015, 1, 1), 'lastUpdateDate': datetime(2015, 1, 1), 'roleArn': 'string', 'status': { 'state': 'CREATING'|'UPDATING'|'DELETING'|'ACTIVE'|'FAILED', 'error': { 'code': 'INTERNAL_FAILURE'|'VALIDATION_ERROR'|'LIMIT_EXCEEDED', 'message': 'string' } } }, ], 'nextToken': 'string' }
Response Structure
(dict) --
portalSummaries (list) --
A list that summarizes each portal.
(dict) --
Contains a portal summary.
id (string) --
The ID of the portal.
name (string) --
The name of the portal.
description (string) --
The portal's description.
startUrl (string) --
The public root URL for the AWS IoT AWS IoT SiteWise Monitor application portal.
creationDate (datetime) --
The date the portal was created, in Unix epoch time.
lastUpdateDate (datetime) --
The date the portal was last updated, in Unix epoch time.
roleArn (string) --
The ARN of the service role that allows the portal's users to access your AWS IoT SiteWise resources on your behalf. For more information, see Using service roles for AWS IoT SiteWise Monitor in the AWS IoT SiteWise User Guide .
status (dict) --
Contains information about the current status of a portal.
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.
nextToken (string) --
The token for the next set of results, or null if there are no additional results.
{'portalStatus': {'error': {'code': {'LIMIT_EXCEEDED', 'VALIDATION_ERROR'}}}}
Updates an AWS IoT SiteWise Monitor portal.
See also: AWS API Documentation
Request Syntax
client.update_portal( portalId='string', portalName='string', portalDescription='string', portalContactEmail='string', portalLogoImage={ 'id': 'string', 'file': { 'data': b'bytes', 'type': 'PNG' } }, roleArn='string', clientToken='string' )
string
[REQUIRED]
The ID of the portal to update.
string
[REQUIRED]
A new friendly name for the portal.
string
A new description for the portal.
string
[REQUIRED]
The AWS administrator's contact email address.
dict
Contains an image that is one of the following:
An image file. Choose this option to upload a new image.
The ID of an existing image. Choose this option to keep an existing image.
id (string) --
The ID of an existing image. Specify this parameter to keep an existing image.
file (dict) --
Contains an image file.
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.
string
[REQUIRED]
The ARN of a service role that allows the portal's users to access your AWS IoT SiteWise resources on your behalf. For more information, see Using service roles for AWS IoT SiteWise Monitor in the AWS IoT SiteWise User Guide .
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.
dict
Response Syntax
{ 'portalStatus': { 'state': 'CREATING'|'UPDATING'|'DELETING'|'ACTIVE'|'FAILED', 'error': { 'code': 'INTERNAL_FAILURE'|'VALIDATION_ERROR'|'LIMIT_EXCEEDED', 'message': 'string' } } }
Response Structure
(dict) --
portalStatus (dict) --
The status of the portal, which contains a state (UPDATING 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.