create_asset_model_composite_model
¶
create_asset_model_composite_model(
asset_model_id: CustomID,
asset_model_composite_model_name: Name,
asset_model_composite_model_type: Name,
*,
config_overrides: Optional[IoTSiteWiseClientConfig] = None,
asset_model_composite_model_external_id: Optional[ExternalId] = None,
parent_asset_model_composite_model_id: Optional[CustomID] = None,
asset_model_composite_model_id: Optional[ID] = None,
asset_model_composite_model_description: Optional[Description] = None,
client_token: Optional[ClientToken] = None,
composed_asset_model_id: Optional[CustomID] = None,
asset_model_composite_model_properties: Optional[
AssetModelPropertyDefinitions
] = None,
if_match: Optional[ETag] = None,
if_none_match: Optional[SelectAll] = None,
match_for_version_type: Optional[AssetModelVersionType] = None,
) -> CreateAssetModelCompositeModelResponse
Creates a custom composite model from specified property and hierarchy definitions. There are two types of custom composite models, inline and component-model-based.
Use component-model-based custom composite models to define standard, reusable components. A component-model-based custom composite model consists of a name, a description, and the ID of the component model it references. A component-model-based custom composite model has no properties of its own; its referenced component model provides its associated properties to any created assets. For more information, see Custom composite models (Components) in the IoT SiteWise User Guide.
Use inline custom composite models to organize the properties of an asset model. The properties of inline custom composite models are local to the asset model where they are included and can't be used to create multiple assets.
To create a component-model-based model, specify the composedAssetModelId of an existing asset model with assetModelType of COMPONENT_MODEL.
To create an inline model, specify the assetModelCompositeModelProperties and don't include an composedAssetModelId.
Parameters:
-
asset_model_id(CustomID) –The ID of the asset model this composite model is a part of.
-
asset_model_composite_model_external_id(Optional[ExternalId], default:None) –An external ID to assign to the composite model.
If the composite model is a derived composite model, or one nested inside a component model, you can only set the external ID using
UpdateAssetModelCompositeModeland specifying the derived ID of the model or property from the created model it's a part of. -
parent_asset_model_composite_model_id(Optional[CustomID], default:None) –The ID of the parent composite model in this asset model relationship.
-
asset_model_composite_model_id(Optional[ID], default:None) –The ID of the composite model. IoT SiteWise automatically generates a unique ID for you, so this parameter is never required. However, if you prefer to supply your own ID instead, you can specify it here in UUID format. If you specify your own ID, it must be globally unique.
-
asset_model_composite_model_description(Optional[Description], default:None) –A description for the composite model.
-
asset_model_composite_model_name(Name) –A unique name for the composite model.
-
asset_model_composite_model_type(Name) –The composite model type. Valid values are
AWS/ALARM,CUSTOM, orAWS/L4E_ANOMALY. -
client_token(Optional[ClientToken], default:None) –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.
-
composed_asset_model_id(Optional[CustomID], default:None) –The ID of a component model which is reused to create this composite model.
-
asset_model_composite_model_properties(Optional[AssetModelPropertyDefinitions], default:None) –The property definitions of the composite model. For more information, see Inline custom composite models in the IoT SiteWise User Guide.
You can specify up to 200 properties per composite model. For more information, see Quotas in the IoT SiteWise User Guide.
-
if_match(Optional[ETag], default:None) –The expected current entity tag (ETag) for the asset model’s latest or active version (specified using
matchForVersionType). The create request is rejected if the tag does not match the latest or active version's current entity tag. See Optimistic locking for asset model writes in the IoT SiteWise User Guide. -
if_none_match(Optional[SelectAll], default:None) –Accepts * to reject the create request if an active version (specified using
matchForVersionTypeasACTIVE) already exists for the asset model. -
match_for_version_type(Optional[AssetModelVersionType], default:None) –Specifies the asset model version type (
LATESTorACTIVE) used in conjunction withIf-MatchorIf-None-Matchheaders to determine the target ETag for the create operation.
Raises:
-
ConflictingOperationException–Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.
-
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.
-
PreconditionFailedException–The precondition in one or more of the request-header fields evaluated to
FALSE. -
ResourceAlreadyExistsException–The resource already exists.
-
ResourceNotFoundException–The requested resource can't be found.
-
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
1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 | |