create_metric
async
¶
create_metric(
instance_id: InstanceId,
name: MetricName,
metric_calculation: MetricCalculation,
unit: MetricUnit,
*,
config_overrides: Optional[AsyncConnectClientConfig] = None,
status: Optional[MetricStatus] = None,
client_token: Optional[ClientToken] = None,
description: Optional[MetricDescription] = None,
positive_trend_indicator: Optional[TrendIndicator] = None,
tags: Optional[TagMap] = None,
) -> CreateMetricResponse
Creates a new metric definition for the specified Connect Customer instance. You can create custom metrics that use formulas referencing existing Amazon Web Services-managed metrics, optionally with filters applied.
Parameters:
-
instance_id(InstanceId) –The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.
-
name(MetricName) –The name of the metric.
-
metric_calculation(MetricCalculation) –The calculation definition for the metric, including the formula expression and the component metrics it references.
-
unit(MetricUnit) –The display unit for the metric's data.
-
status(Optional[MetricStatus], default:None) –The publish status of the metric. Set to
PUBLISHEDto make the metric available for use in dashboards and reports, orSAVEDto keep it in draft state. -
client_token(Optional[ClientToken], default:None) –A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.
-
description(Optional[MetricDescription], default:None) –The description of the metric.
-
positive_trend_indicator(Optional[TrendIndicator], default:None) –How an increase in the metric value should be interpreted. Valid values:
POSITIVE,NEUTRAL,NEGATIVE. -
tags(Optional[TagMap], default:None) –The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.
Raises:
-
AccessDeniedException–You do not have sufficient permissions to perform this action.
-
DuplicateResourceException–A resource with the specified name already exists.
-
InternalServiceException–Request processing failed because of an error or failure with the service.
-
InvalidParameterException–One or more of the specified parameters are not valid.
-
InvalidRequestException–The request is not valid.
-
LimitExceededException–The allowed limit for the resource has been exceeded.
-
ResourceNotFoundException–The specified resource was not found.
-
ThrottlingException–The throttling limit has been exceeded.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_connect/_services/async_connect.py
4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 | |