create_metric
¶
create_metric(
instance_id: InstanceId,
name: MetricName,
metric_calculation: MetricCalculation,
unit: MetricUnit,
*,
config_overrides: Optional[ConnectClientConfig] = 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/connect.py
4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 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 | |