1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[derive(Debug)]
pub(crate) struct Handle {
pub(crate) client: aws_smithy_client::Client<
aws_smithy_client::erase::DynConnector,
aws_smithy_client::erase::DynMiddleware<aws_smithy_client::erase::DynConnector>,
>,
pub(crate) conf: crate::Config,
}
/// Client for AWS Performance Insights
///
/// Client for invoking operations on AWS Performance Insights. Each operation on AWS Performance Insights is a method on this
/// this struct. `.send()` MUST be invoked on the generated operations to dispatch the request to the service.
///
/// # Examples
/// **Constructing a client and invoking an operation**
/// ```rust,no_run
/// # async fn docs() {
/// // create a shared configuration. This can be used & shared between multiple service clients.
/// let shared_config = aws_config::load_from_env().await;
/// let client = aws_sdk_pi::Client::new(&shared_config);
/// // invoke an operation
/// /* let rsp = client
/// .<operation_name>().
/// .<param>("some value")
/// .send().await; */
/// # }
/// ```
/// **Constructing a client with custom configuration**
/// ```rust,no_run
/// use aws_config::RetryConfig;
/// # async fn docs() {
/// let shared_config = aws_config::load_from_env().await;
/// let config = aws_sdk_pi::config::Builder::from(&shared_config)
/// .retry_config(RetryConfig::disabled())
/// .build();
/// let client = aws_sdk_pi::Client::from_conf(config);
/// # }
#[derive(std::fmt::Debug)]
pub struct Client {
handle: std::sync::Arc<Handle>,
}
impl std::clone::Clone for Client {
fn clone(&self) -> Self {
Self {
handle: self.handle.clone(),
}
}
}
#[doc(inline)]
pub use aws_smithy_client::Builder;
impl
From<
aws_smithy_client::Client<
aws_smithy_client::erase::DynConnector,
aws_smithy_client::erase::DynMiddleware<aws_smithy_client::erase::DynConnector>,
>,
> for Client
{
fn from(
client: aws_smithy_client::Client<
aws_smithy_client::erase::DynConnector,
aws_smithy_client::erase::DynMiddleware<aws_smithy_client::erase::DynConnector>,
>,
) -> Self {
Self::with_config(client, crate::Config::builder().build())
}
}
impl Client {
/// Creates a client with the given service configuration.
pub fn with_config(
client: aws_smithy_client::Client<
aws_smithy_client::erase::DynConnector,
aws_smithy_client::erase::DynMiddleware<aws_smithy_client::erase::DynConnector>,
>,
conf: crate::Config,
) -> Self {
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
/// Returns the client's configuration.
pub fn conf(&self) -> &crate::Config {
&self.handle.conf
}
}
impl Client {
/// Constructs a fluent builder for the [`DescribeDimensionKeys`](crate::client::fluent_builders::DescribeDimensionKeys) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::DescribeDimensionKeys::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`service_type(ServiceType)`](crate::client::fluent_builders::DescribeDimensionKeys::service_type) / [`set_service_type(Option<ServiceType>)`](crate::client::fluent_builders::DescribeDimensionKeys::set_service_type): <p>The Amazon Web Services service for which Performance Insights will return metrics. Valid values are as follows:</p> <ul> <li> <p> <code>RDS</code> </p> </li> <li> <p> <code>DOCDB</code> </p> </li> </ul>
/// - [`identifier(impl Into<String>)`](crate::client::fluent_builders::DescribeDimensionKeys::identifier) / [`set_identifier(Option<String>)`](crate::client::fluent_builders::DescribeDimensionKeys::set_identifier): <p>An immutable, Amazon Web Services Region-unique identifier for a data source. Performance Insights gathers metrics from this data source.</p> <p>To use an Amazon RDS instance as a data source, you specify its <code>DbiResourceId</code> value. For example, specify <code>db-FAIHNTYBKTGAUSUZQYPDS2GW4A</code>. </p>
/// - [`start_time(DateTime)`](crate::client::fluent_builders::DescribeDimensionKeys::start_time) / [`set_start_time(Option<DateTime>)`](crate::client::fluent_builders::DescribeDimensionKeys::set_start_time): <p>The date and time specifying the beginning of the requested time series data. You must specify a <code>StartTime</code> within the past 7 days. The value specified is <i>inclusive</i>, which means that data points equal to or greater than <code>StartTime</code> are returned. </p> <p>The value for <code>StartTime</code> must be earlier than the value for <code>EndTime</code>. </p>
/// - [`end_time(DateTime)`](crate::client::fluent_builders::DescribeDimensionKeys::end_time) / [`set_end_time(Option<DateTime>)`](crate::client::fluent_builders::DescribeDimensionKeys::set_end_time): <p>The date and time specifying the end of the requested time series data. The value specified is <i>exclusive</i>, which means that data points less than (but not equal to) <code>EndTime</code> are returned.</p> <p>The value for <code>EndTime</code> must be later than the value for <code>StartTime</code>.</p>
/// - [`metric(impl Into<String>)`](crate::client::fluent_builders::DescribeDimensionKeys::metric) / [`set_metric(Option<String>)`](crate::client::fluent_builders::DescribeDimensionKeys::set_metric): <p>The name of a Performance Insights metric to be measured.</p> <p>Valid values for <code>Metric</code> are:</p> <ul> <li> <p> <code>db.load.avg</code> - A scaled representation of the number of active sessions for the database engine. </p> </li> <li> <p> <code>db.sampledload.avg</code> - The raw number of active sessions for the database engine. </p> </li> </ul> <p>If the number of active sessions is less than an internal Performance Insights threshold, <code>db.load.avg</code> and <code>db.sampledload.avg</code> are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with <code>db.load.avg</code> showing the scaled values, <code>db.sampledload.avg</code> showing the raw values, and <code>db.sampledload.avg</code> less than <code>db.load.avg</code>. For most use cases, you can query <code>db.load.avg</code> only. </p>
/// - [`period_in_seconds(i32)`](crate::client::fluent_builders::DescribeDimensionKeys::period_in_seconds) / [`set_period_in_seconds(Option<i32>)`](crate::client::fluent_builders::DescribeDimensionKeys::set_period_in_seconds): <p>The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are: </p> <ul> <li> <p> <code>1</code> (one second)</p> </li> <li> <p> <code>60</code> (one minute)</p> </li> <li> <p> <code>300</code> (five minutes)</p> </li> <li> <p> <code>3600</code> (one hour)</p> </li> <li> <p> <code>86400</code> (twenty-four hours)</p> </li> </ul> <p>If you don't specify <code>PeriodInSeconds</code>, then Performance Insights chooses a value for you, with a goal of returning roughly 100-200 data points in the response. </p>
/// - [`group_by(DimensionGroup)`](crate::client::fluent_builders::DescribeDimensionKeys::group_by) / [`set_group_by(Option<DimensionGroup>)`](crate::client::fluent_builders::DescribeDimensionKeys::set_group_by): <p>A specification for how to aggregate the data points from a query result. You must specify a valid dimension group. Performance Insights returns all dimensions within this group, unless you provide the names of specific dimensions within this group. You can also request that Performance Insights return a limited number of values for a dimension. </p>
/// - [`additional_metrics(Vec<String>)`](crate::client::fluent_builders::DescribeDimensionKeys::additional_metrics) / [`set_additional_metrics(Option<Vec<String>>)`](crate::client::fluent_builders::DescribeDimensionKeys::set_additional_metrics): <p>Additional metrics for the top <code>N</code> dimension keys. If the specified dimension group in the <code>GroupBy</code> parameter is <code>db.sql_tokenized</code>, you can specify per-SQL metrics to get the values for the top <code>N</code> SQL digests. The response syntax is as follows: <code>"AdditionalMetrics" : { "<i>string</i>" : "<i>string</i>" }</code>. </p>
/// - [`partition_by(DimensionGroup)`](crate::client::fluent_builders::DescribeDimensionKeys::partition_by) / [`set_partition_by(Option<DimensionGroup>)`](crate::client::fluent_builders::DescribeDimensionKeys::set_partition_by): <p>For each dimension specified in <code>GroupBy</code>, specify a secondary dimension to further subdivide the partition keys in the response. </p>
/// - [`filter(HashMap<String, String>)`](crate::client::fluent_builders::DescribeDimensionKeys::filter) / [`set_filter(Option<HashMap<String, String>>)`](crate::client::fluent_builders::DescribeDimensionKeys::set_filter): <p>One or more filters to apply in the request. Restrictions:</p> <ul> <li> <p>Any number of filters by the same dimension, as specified in the <code>GroupBy</code> or <code>Partition</code> parameters.</p> </li> <li> <p>A single filter for any other dimension in this dimension group.</p> </li> </ul>
/// - [`max_results(i32)`](crate::client::fluent_builders::DescribeDimensionKeys::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::DescribeDimensionKeys::set_max_results): <p>The maximum number of items to return in the response. If more items exist than the specified <code>MaxRecords</code> value, a pagination token is included in the response so that the remaining results can be retrieved. </p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::DescribeDimensionKeys::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::DescribeDimensionKeys::set_next_token): <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>.</p>
/// - On success, responds with [`DescribeDimensionKeysOutput`](crate::output::DescribeDimensionKeysOutput) with field(s):
/// - [`aligned_start_time(Option<DateTime>)`](crate::output::DescribeDimensionKeysOutput::aligned_start_time): <p>The start time for the returned dimension keys, after alignment to a granular boundary (as specified by <code>PeriodInSeconds</code>). <code>AlignedStartTime</code> will be less than or equal to the value of the user-specified <code>StartTime</code>. </p>
/// - [`aligned_end_time(Option<DateTime>)`](crate::output::DescribeDimensionKeysOutput::aligned_end_time): <p>The end time for the returned dimension keys, after alignment to a granular boundary (as specified by <code>PeriodInSeconds</code>). <code>AlignedEndTime</code> will be greater than or equal to the value of the user-specified <code>Endtime</code>. </p>
/// - [`partition_keys(Option<Vec<ResponsePartitionKey>>)`](crate::output::DescribeDimensionKeysOutput::partition_keys): <p>If <code>PartitionBy</code> was present in the request, <code>PartitionKeys</code> contains the breakdown of dimension keys by the specified partitions. </p>
/// - [`keys(Option<Vec<DimensionKeyDescription>>)`](crate::output::DescribeDimensionKeysOutput::keys): <p>The dimension keys that were requested.</p>
/// - [`next_token(Option<String>)`](crate::output::DescribeDimensionKeysOutput::next_token): <p>A pagination token that indicates the response didn’t return all available records because <code>MaxRecords</code> was specified in the previous request. To get the remaining records, specify <code>NextToken</code> in a separate request with this value. </p>
/// - On failure, responds with [`SdkError<DescribeDimensionKeysError>`](crate::error::DescribeDimensionKeysError)
pub fn describe_dimension_keys(&self) -> fluent_builders::DescribeDimensionKeys {
fluent_builders::DescribeDimensionKeys::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`GetDimensionKeyDetails`](crate::client::fluent_builders::GetDimensionKeyDetails) operation.
///
/// - The fluent builder is configurable:
/// - [`service_type(ServiceType)`](crate::client::fluent_builders::GetDimensionKeyDetails::service_type) / [`set_service_type(Option<ServiceType>)`](crate::client::fluent_builders::GetDimensionKeyDetails::set_service_type): <p>The Amazon Web Services service for which Performance Insights returns data. The only valid value is <code>RDS</code>.</p>
/// - [`identifier(impl Into<String>)`](crate::client::fluent_builders::GetDimensionKeyDetails::identifier) / [`set_identifier(Option<String>)`](crate::client::fluent_builders::GetDimensionKeyDetails::set_identifier): <p>The ID for a data source from which to gather dimension data. This ID must be immutable and unique within an Amazon Web Services Region. When a DB instance is the data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>. </p>
/// - [`group(impl Into<String>)`](crate::client::fluent_builders::GetDimensionKeyDetails::group) / [`set_group(Option<String>)`](crate::client::fluent_builders::GetDimensionKeyDetails::set_group): <p>The name of the dimension group. Performance Insights searches the specified group for the dimension group ID. The following group name values are valid:</p> <ul> <li> <p> <code>db.query</code> (Amazon DocumentDB only)</p> </li> <li> <p> <code>db.sql</code> (Amazon RDS and Aurora only)</p> </li> </ul>
/// - [`group_identifier(impl Into<String>)`](crate::client::fluent_builders::GetDimensionKeyDetails::group_identifier) / [`set_group_identifier(Option<String>)`](crate::client::fluent_builders::GetDimensionKeyDetails::set_group_identifier): <p>The ID of the dimension group from which to retrieve dimension details. For dimension group <code>db.sql</code>, the group ID is <code>db.sql.id</code>. The following group ID values are valid:</p> <ul> <li> <p> <code>db.sql.id</code> for dimension group <code>db.sql</code> (Aurora and RDS only)</p> </li> <li> <p> <code>db.query.id</code> for dimension group <code>db.query</code> (DocumentDB only)</p> </li> </ul>
/// - [`requested_dimensions(Vec<String>)`](crate::client::fluent_builders::GetDimensionKeyDetails::requested_dimensions) / [`set_requested_dimensions(Option<Vec<String>>)`](crate::client::fluent_builders::GetDimensionKeyDetails::set_requested_dimensions): <p>A list of dimensions to retrieve the detail data for within the given dimension group. If you don't specify this parameter, Performance Insights returns all dimension data within the specified dimension group. Specify dimension names for the following dimension groups:</p> <ul> <li> <p> <code>db.sql</code> - Specify either the full dimension name <code>db.sql.statement</code> or the short dimension name <code>statement</code> (Aurora and RDS only).</p> </li> <li> <p> <code>db.query</code> - Specify either the full dimension name <code>db.query.statement</code> or the short dimension name <code>statement</code> (DocumentDB only).</p> </li> </ul>
/// - On success, responds with [`GetDimensionKeyDetailsOutput`](crate::output::GetDimensionKeyDetailsOutput) with field(s):
/// - [`dimensions(Option<Vec<DimensionKeyDetail>>)`](crate::output::GetDimensionKeyDetailsOutput::dimensions): <p>The details for the requested dimensions.</p>
/// - On failure, responds with [`SdkError<GetDimensionKeyDetailsError>`](crate::error::GetDimensionKeyDetailsError)
pub fn get_dimension_key_details(&self) -> fluent_builders::GetDimensionKeyDetails {
fluent_builders::GetDimensionKeyDetails::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`GetResourceMetadata`](crate::client::fluent_builders::GetResourceMetadata) operation.
///
/// - The fluent builder is configurable:
/// - [`service_type(ServiceType)`](crate::client::fluent_builders::GetResourceMetadata::service_type) / [`set_service_type(Option<ServiceType>)`](crate::client::fluent_builders::GetResourceMetadata::set_service_type): <p>The Amazon Web Services service for which Performance Insights returns metrics.</p>
/// - [`identifier(impl Into<String>)`](crate::client::fluent_builders::GetResourceMetadata::identifier) / [`set_identifier(Option<String>)`](crate::client::fluent_builders::GetResourceMetadata::set_identifier): <p>An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use a DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>. </p>
/// - On success, responds with [`GetResourceMetadataOutput`](crate::output::GetResourceMetadataOutput) with field(s):
/// - [`identifier(Option<String>)`](crate::output::GetResourceMetadataOutput::identifier): <p>An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use a DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>. </p>
/// - [`features(Option<HashMap<String, FeatureMetadata>>)`](crate::output::GetResourceMetadataOutput::features): <p>The metadata for different features. For example, the metadata might indicate that a feature is turned on or off on a specific DB instance.</p>
/// - On failure, responds with [`SdkError<GetResourceMetadataError>`](crate::error::GetResourceMetadataError)
pub fn get_resource_metadata(&self) -> fluent_builders::GetResourceMetadata {
fluent_builders::GetResourceMetadata::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`GetResourceMetrics`](crate::client::fluent_builders::GetResourceMetrics) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::GetResourceMetrics::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`service_type(ServiceType)`](crate::client::fluent_builders::GetResourceMetrics::service_type) / [`set_service_type(Option<ServiceType>)`](crate::client::fluent_builders::GetResourceMetrics::set_service_type): <p>The Amazon Web Services service for which Performance Insights returns metrics. Valid values are as follows:</p> <ul> <li> <p> <code>RDS</code> </p> </li> <li> <p> <code>DOCDB</code> </p> </li> </ul>
/// - [`identifier(impl Into<String>)`](crate::client::fluent_builders::GetResourceMetrics::identifier) / [`set_identifier(Option<String>)`](crate::client::fluent_builders::GetResourceMetrics::set_identifier): <p>An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as <i>ResourceID</i>. When you call <code>DescribeDBInstances</code>, the identifier is returned as <code>DbiResourceId</code>.</p> <p>To use a DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>.</p>
/// - [`metric_queries(Vec<MetricQuery>)`](crate::client::fluent_builders::GetResourceMetrics::metric_queries) / [`set_metric_queries(Option<Vec<MetricQuery>>)`](crate::client::fluent_builders::GetResourceMetrics::set_metric_queries): <p>An array of one or more queries to perform. Each query must specify a Performance Insights metric, and can optionally specify aggregation and filtering criteria.</p>
/// - [`start_time(DateTime)`](crate::client::fluent_builders::GetResourceMetrics::start_time) / [`set_start_time(Option<DateTime>)`](crate::client::fluent_builders::GetResourceMetrics::set_start_time): <p>The date and time specifying the beginning of the requested time series query range. You can't specify a <code>StartTime</code> that is earlier than 7 days ago. By default, Performance Insights has 7 days of retention, but you can extend this range up to 2 years. The value specified is <i>inclusive</i>. Thus, the command returns data points equal to or greater than <code>StartTime</code>.</p> <p>The value for <code>StartTime</code> must be earlier than the value for <code>EndTime</code>.</p>
/// - [`end_time(DateTime)`](crate::client::fluent_builders::GetResourceMetrics::end_time) / [`set_end_time(Option<DateTime>)`](crate::client::fluent_builders::GetResourceMetrics::set_end_time): <p>The date and time specifying the end of the requested time series query range. The value specified is <i>exclusive</i>. Thus, the command returns data points less than (but not equal to) <code>EndTime</code>.</p> <p>The value for <code>EndTime</code> must be later than the value for <code>StartTime</code>.</p>
/// - [`period_in_seconds(i32)`](crate::client::fluent_builders::GetResourceMetrics::period_in_seconds) / [`set_period_in_seconds(Option<i32>)`](crate::client::fluent_builders::GetResourceMetrics::set_period_in_seconds): <p>The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are:</p> <ul> <li> <p> <code>1</code> (one second)</p> </li> <li> <p> <code>60</code> (one minute)</p> </li> <li> <p> <code>300</code> (five minutes)</p> </li> <li> <p> <code>3600</code> (one hour)</p> </li> <li> <p> <code>86400</code> (twenty-four hours)</p> </li> </ul> <p>If you don't specify <code>PeriodInSeconds</code>, then Performance Insights will choose a value for you, with a goal of returning roughly 100-200 data points in the response.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::GetResourceMetrics::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::GetResourceMetrics::set_max_results): <p>The maximum number of items to return in the response. If more items exist than the specified <code>MaxRecords</code> value, a pagination token is included in the response so that the remaining results can be retrieved. </p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::GetResourceMetrics::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::GetResourceMetrics::set_next_token): <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>.</p>
/// - On success, responds with [`GetResourceMetricsOutput`](crate::output::GetResourceMetricsOutput) with field(s):
/// - [`aligned_start_time(Option<DateTime>)`](crate::output::GetResourceMetricsOutput::aligned_start_time): <p>The start time for the returned metrics, after alignment to a granular boundary (as specified by <code>PeriodInSeconds</code>). <code>AlignedStartTime</code> will be less than or equal to the value of the user-specified <code>StartTime</code>.</p>
/// - [`aligned_end_time(Option<DateTime>)`](crate::output::GetResourceMetricsOutput::aligned_end_time): <p>The end time for the returned metrics, after alignment to a granular boundary (as specified by <code>PeriodInSeconds</code>). <code>AlignedEndTime</code> will be greater than or equal to the value of the user-specified <code>Endtime</code>.</p>
/// - [`identifier(Option<String>)`](crate::output::GetResourceMetricsOutput::identifier): <p>An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as <i>ResourceID</i>. When you call <code>DescribeDBInstances</code>, the identifier is returned as <code>DbiResourceId</code>.</p>
/// - [`metric_list(Option<Vec<MetricKeyDataPoints>>)`](crate::output::GetResourceMetricsOutput::metric_list): <p>An array of metric results, where each array element contains all of the data points for a particular dimension.</p>
/// - [`next_token(Option<String>)`](crate::output::GetResourceMetricsOutput::next_token): <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>. </p>
/// - On failure, responds with [`SdkError<GetResourceMetricsError>`](crate::error::GetResourceMetricsError)
pub fn get_resource_metrics(&self) -> fluent_builders::GetResourceMetrics {
fluent_builders::GetResourceMetrics::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`ListAvailableResourceDimensions`](crate::client::fluent_builders::ListAvailableResourceDimensions) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::ListAvailableResourceDimensions::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`service_type(ServiceType)`](crate::client::fluent_builders::ListAvailableResourceDimensions::service_type) / [`set_service_type(Option<ServiceType>)`](crate::client::fluent_builders::ListAvailableResourceDimensions::set_service_type): <p>The Amazon Web Services service for which Performance Insights returns metrics.</p>
/// - [`identifier(impl Into<String>)`](crate::client::fluent_builders::ListAvailableResourceDimensions::identifier) / [`set_identifier(Option<String>)`](crate::client::fluent_builders::ListAvailableResourceDimensions::set_identifier): <p>An immutable identifier for a data source that is unique within an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use an Amazon RDS DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VWZ</code>. </p>
/// - [`metrics(Vec<String>)`](crate::client::fluent_builders::ListAvailableResourceDimensions::metrics) / [`set_metrics(Option<Vec<String>>)`](crate::client::fluent_builders::ListAvailableResourceDimensions::set_metrics): <p>The types of metrics for which to retrieve dimensions. Valid values include <code>db.load</code>.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::ListAvailableResourceDimensions::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::ListAvailableResourceDimensions::set_max_results): <p>The maximum number of items to return in the response. If more items exist than the specified <code>MaxRecords</code> value, a pagination token is included in the response so that the remaining results can be retrieved.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::ListAvailableResourceDimensions::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::ListAvailableResourceDimensions::set_next_token): <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>. </p>
/// - On success, responds with [`ListAvailableResourceDimensionsOutput`](crate::output::ListAvailableResourceDimensionsOutput) with field(s):
/// - [`metric_dimensions(Option<Vec<MetricDimensionGroups>>)`](crate::output::ListAvailableResourceDimensionsOutput::metric_dimensions): <p>The dimension information returned for requested metric types.</p>
/// - [`next_token(Option<String>)`](crate::output::ListAvailableResourceDimensionsOutput::next_token): <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>.</p>
/// - On failure, responds with [`SdkError<ListAvailableResourceDimensionsError>`](crate::error::ListAvailableResourceDimensionsError)
pub fn list_available_resource_dimensions(
&self,
) -> fluent_builders::ListAvailableResourceDimensions {
fluent_builders::ListAvailableResourceDimensions::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`ListAvailableResourceMetrics`](crate::client::fluent_builders::ListAvailableResourceMetrics) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::ListAvailableResourceMetrics::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`service_type(ServiceType)`](crate::client::fluent_builders::ListAvailableResourceMetrics::service_type) / [`set_service_type(Option<ServiceType>)`](crate::client::fluent_builders::ListAvailableResourceMetrics::set_service_type): <p>The Amazon Web Services service for which Performance Insights returns metrics.</p>
/// - [`identifier(impl Into<String>)`](crate::client::fluent_builders::ListAvailableResourceMetrics::identifier) / [`set_identifier(Option<String>)`](crate::client::fluent_builders::ListAvailableResourceMetrics::set_identifier): <p>An immutable identifier for a data source that is unique within an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use an Amazon RDS DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VWZ</code>. </p>
/// - [`metric_types(Vec<String>)`](crate::client::fluent_builders::ListAvailableResourceMetrics::metric_types) / [`set_metric_types(Option<Vec<String>>)`](crate::client::fluent_builders::ListAvailableResourceMetrics::set_metric_types): <p>The types of metrics to return in the response. Valid values in the array include the following:</p> <ul> <li> <p> <code>os</code> (OS counter metrics) - All engines</p> </li> <li> <p> <code>db</code> (DB load metrics) - All engines except for Amazon DocumentDB</p> </li> <li> <p> <code>db.sql.stats</code> (per-SQL metrics) - All engines except for Amazon DocumentDB</p> </li> <li> <p> <code>db.sql_tokenized.stats</code> (per-SQL digest metrics) - All engines except for Amazon DocumentDB</p> </li> </ul>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::ListAvailableResourceMetrics::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::ListAvailableResourceMetrics::set_next_token): <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>. </p>
/// - [`max_results(i32)`](crate::client::fluent_builders::ListAvailableResourceMetrics::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::ListAvailableResourceMetrics::set_max_results): <p>The maximum number of items to return. If the <code>MaxRecords</code> value is less than the number of existing items, the response includes a pagination token. </p>
/// - On success, responds with [`ListAvailableResourceMetricsOutput`](crate::output::ListAvailableResourceMetricsOutput) with field(s):
/// - [`metrics(Option<Vec<ResponseResourceMetric>>)`](crate::output::ListAvailableResourceMetricsOutput::metrics): <p>An array of metrics available to query. Each array element contains the full name, description, and unit of the metric. </p>
/// - [`next_token(Option<String>)`](crate::output::ListAvailableResourceMetricsOutput::next_token): <p>A pagination token that indicates the response didn’t return all available records because <code>MaxRecords</code> was specified in the previous request. To get the remaining records, specify <code>NextToken</code> in a separate request with this value. </p>
/// - On failure, responds with [`SdkError<ListAvailableResourceMetricsError>`](crate::error::ListAvailableResourceMetricsError)
pub fn list_available_resource_metrics(&self) -> fluent_builders::ListAvailableResourceMetrics {
fluent_builders::ListAvailableResourceMetrics::new(self.handle.clone())
}
}
pub mod fluent_builders {
//!
//! Utilities to ergonomically construct a request to the service.
//!
//! Fluent builders are created through the [`Client`](crate::client::Client) by calling
//! one if its operation methods. After parameters are set using the builder methods,
//! the `send` method can be called to initiate the request.
//!
/// Fluent builder constructing a request to `DescribeDimensionKeys`.
///
/// <p>For a specific time period, retrieve the top <code>N</code> dimension keys for a metric. </p> <note>
/// <p>Each response element returns a maximum of 500 bytes. For larger elements, such as SQL statements, only the first 500 bytes are returned.</p>
/// </note>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeDimensionKeys {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::describe_dimension_keys_input::Builder,
}
impl DescribeDimensionKeys {
/// Creates a new `DescribeDimensionKeys`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeDimensionKeysOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeDimensionKeysError>,
> {
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::DescribeDimensionKeysPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::DescribeDimensionKeysPaginator {
crate::paginator::DescribeDimensionKeysPaginator::new(self.handle, self.inner)
}
/// <p>The Amazon Web Services service for which Performance Insights will return metrics. Valid values are as follows:</p>
/// <ul>
/// <li> <p> <code>RDS</code> </p> </li>
/// <li> <p> <code>DOCDB</code> </p> </li>
/// </ul>
pub fn service_type(mut self, input: crate::model::ServiceType) -> Self {
self.inner = self.inner.service_type(input);
self
}
/// <p>The Amazon Web Services service for which Performance Insights will return metrics. Valid values are as follows:</p>
/// <ul>
/// <li> <p> <code>RDS</code> </p> </li>
/// <li> <p> <code>DOCDB</code> </p> </li>
/// </ul>
pub fn set_service_type(
mut self,
input: std::option::Option<crate::model::ServiceType>,
) -> Self {
self.inner = self.inner.set_service_type(input);
self
}
/// <p>An immutable, Amazon Web Services Region-unique identifier for a data source. Performance Insights gathers metrics from this data source.</p>
/// <p>To use an Amazon RDS instance as a data source, you specify its <code>DbiResourceId</code> value. For example, specify <code>db-FAIHNTYBKTGAUSUZQYPDS2GW4A</code>. </p>
pub fn identifier(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.identifier(input.into());
self
}
/// <p>An immutable, Amazon Web Services Region-unique identifier for a data source. Performance Insights gathers metrics from this data source.</p>
/// <p>To use an Amazon RDS instance as a data source, you specify its <code>DbiResourceId</code> value. For example, specify <code>db-FAIHNTYBKTGAUSUZQYPDS2GW4A</code>. </p>
pub fn set_identifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_identifier(input);
self
}
/// <p>The date and time specifying the beginning of the requested time series data. You must specify a <code>StartTime</code> within the past 7 days. The value specified is <i>inclusive</i>, which means that data points equal to or greater than <code>StartTime</code> are returned. </p>
/// <p>The value for <code>StartTime</code> must be earlier than the value for <code>EndTime</code>. </p>
pub fn start_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.start_time(input);
self
}
/// <p>The date and time specifying the beginning of the requested time series data. You must specify a <code>StartTime</code> within the past 7 days. The value specified is <i>inclusive</i>, which means that data points equal to or greater than <code>StartTime</code> are returned. </p>
/// <p>The value for <code>StartTime</code> must be earlier than the value for <code>EndTime</code>. </p>
pub fn set_start_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_start_time(input);
self
}
/// <p>The date and time specifying the end of the requested time series data. The value specified is <i>exclusive</i>, which means that data points less than (but not equal to) <code>EndTime</code> are returned.</p>
/// <p>The value for <code>EndTime</code> must be later than the value for <code>StartTime</code>.</p>
pub fn end_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.end_time(input);
self
}
/// <p>The date and time specifying the end of the requested time series data. The value specified is <i>exclusive</i>, which means that data points less than (but not equal to) <code>EndTime</code> are returned.</p>
/// <p>The value for <code>EndTime</code> must be later than the value for <code>StartTime</code>.</p>
pub fn set_end_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_end_time(input);
self
}
/// <p>The name of a Performance Insights metric to be measured.</p>
/// <p>Valid values for <code>Metric</code> are:</p>
/// <ul>
/// <li> <p> <code>db.load.avg</code> - A scaled representation of the number of active sessions for the database engine. </p> </li>
/// <li> <p> <code>db.sampledload.avg</code> - The raw number of active sessions for the database engine. </p> </li>
/// </ul>
/// <p>If the number of active sessions is less than an internal Performance Insights threshold, <code>db.load.avg</code> and <code>db.sampledload.avg</code> are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with <code>db.load.avg</code> showing the scaled values, <code>db.sampledload.avg</code> showing the raw values, and <code>db.sampledload.avg</code> less than <code>db.load.avg</code>. For most use cases, you can query <code>db.load.avg</code> only. </p>
pub fn metric(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.metric(input.into());
self
}
/// <p>The name of a Performance Insights metric to be measured.</p>
/// <p>Valid values for <code>Metric</code> are:</p>
/// <ul>
/// <li> <p> <code>db.load.avg</code> - A scaled representation of the number of active sessions for the database engine. </p> </li>
/// <li> <p> <code>db.sampledload.avg</code> - The raw number of active sessions for the database engine. </p> </li>
/// </ul>
/// <p>If the number of active sessions is less than an internal Performance Insights threshold, <code>db.load.avg</code> and <code>db.sampledload.avg</code> are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with <code>db.load.avg</code> showing the scaled values, <code>db.sampledload.avg</code> showing the raw values, and <code>db.sampledload.avg</code> less than <code>db.load.avg</code>. For most use cases, you can query <code>db.load.avg</code> only. </p>
pub fn set_metric(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_metric(input);
self
}
/// <p>The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are: </p>
/// <ul>
/// <li> <p> <code>1</code> (one second)</p> </li>
/// <li> <p> <code>60</code> (one minute)</p> </li>
/// <li> <p> <code>300</code> (five minutes)</p> </li>
/// <li> <p> <code>3600</code> (one hour)</p> </li>
/// <li> <p> <code>86400</code> (twenty-four hours)</p> </li>
/// </ul>
/// <p>If you don't specify <code>PeriodInSeconds</code>, then Performance Insights chooses a value for you, with a goal of returning roughly 100-200 data points in the response. </p>
pub fn period_in_seconds(mut self, input: i32) -> Self {
self.inner = self.inner.period_in_seconds(input);
self
}
/// <p>The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are: </p>
/// <ul>
/// <li> <p> <code>1</code> (one second)</p> </li>
/// <li> <p> <code>60</code> (one minute)</p> </li>
/// <li> <p> <code>300</code> (five minutes)</p> </li>
/// <li> <p> <code>3600</code> (one hour)</p> </li>
/// <li> <p> <code>86400</code> (twenty-four hours)</p> </li>
/// </ul>
/// <p>If you don't specify <code>PeriodInSeconds</code>, then Performance Insights chooses a value for you, with a goal of returning roughly 100-200 data points in the response. </p>
pub fn set_period_in_seconds(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_period_in_seconds(input);
self
}
/// <p>A specification for how to aggregate the data points from a query result. You must specify a valid dimension group. Performance Insights returns all dimensions within this group, unless you provide the names of specific dimensions within this group. You can also request that Performance Insights return a limited number of values for a dimension. </p>
pub fn group_by(mut self, input: crate::model::DimensionGroup) -> Self {
self.inner = self.inner.group_by(input);
self
}
/// <p>A specification for how to aggregate the data points from a query result. You must specify a valid dimension group. Performance Insights returns all dimensions within this group, unless you provide the names of specific dimensions within this group. You can also request that Performance Insights return a limited number of values for a dimension. </p>
pub fn set_group_by(
mut self,
input: std::option::Option<crate::model::DimensionGroup>,
) -> Self {
self.inner = self.inner.set_group_by(input);
self
}
/// Appends an item to `AdditionalMetrics`.
///
/// To override the contents of this collection use [`set_additional_metrics`](Self::set_additional_metrics).
///
/// <p>Additional metrics for the top <code>N</code> dimension keys. If the specified dimension group in the <code>GroupBy</code> parameter is <code>db.sql_tokenized</code>, you can specify per-SQL metrics to get the values for the top <code>N</code> SQL digests. The response syntax is as follows: <code>"AdditionalMetrics" : { "<i>string</i>" : "<i>string</i>" }</code>. </p>
pub fn additional_metrics(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.additional_metrics(input.into());
self
}
/// <p>Additional metrics for the top <code>N</code> dimension keys. If the specified dimension group in the <code>GroupBy</code> parameter is <code>db.sql_tokenized</code>, you can specify per-SQL metrics to get the values for the top <code>N</code> SQL digests. The response syntax is as follows: <code>"AdditionalMetrics" : { "<i>string</i>" : "<i>string</i>" }</code>. </p>
pub fn set_additional_metrics(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_additional_metrics(input);
self
}
/// <p>For each dimension specified in <code>GroupBy</code>, specify a secondary dimension to further subdivide the partition keys in the response. </p>
pub fn partition_by(mut self, input: crate::model::DimensionGroup) -> Self {
self.inner = self.inner.partition_by(input);
self
}
/// <p>For each dimension specified in <code>GroupBy</code>, specify a secondary dimension to further subdivide the partition keys in the response. </p>
pub fn set_partition_by(
mut self,
input: std::option::Option<crate::model::DimensionGroup>,
) -> Self {
self.inner = self.inner.set_partition_by(input);
self
}
/// Adds a key-value pair to `Filter`.
///
/// To override the contents of this collection use [`set_filter`](Self::set_filter).
///
/// <p>One or more filters to apply in the request. Restrictions:</p>
/// <ul>
/// <li> <p>Any number of filters by the same dimension, as specified in the <code>GroupBy</code> or <code>Partition</code> parameters.</p> </li>
/// <li> <p>A single filter for any other dimension in this dimension group.</p> </li>
/// </ul>
pub fn filter(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
self.inner = self.inner.filter(k.into(), v.into());
self
}
/// <p>One or more filters to apply in the request. Restrictions:</p>
/// <ul>
/// <li> <p>Any number of filters by the same dimension, as specified in the <code>GroupBy</code> or <code>Partition</code> parameters.</p> </li>
/// <li> <p>A single filter for any other dimension in this dimension group.</p> </li>
/// </ul>
pub fn set_filter(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.inner = self.inner.set_filter(input);
self
}
/// <p>The maximum number of items to return in the response. If more items exist than the specified <code>MaxRecords</code> value, a pagination token is included in the response so that the remaining results can be retrieved. </p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of items to return in the response. If more items exist than the specified <code>MaxRecords</code> value, a pagination token is included in the response so that the remaining results can be retrieved. </p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
}
/// Fluent builder constructing a request to `GetDimensionKeyDetails`.
///
/// <p>Get the attributes of the specified dimension group for a DB instance or data source. For example, if you specify a SQL ID, <code>GetDimensionKeyDetails</code> retrieves the full text of the dimension <code>db.sql.statement</code> associated with this ID. This operation is useful because <code>GetResourceMetrics</code> and <code>DescribeDimensionKeys</code> don't support retrieval of large SQL statement text.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetDimensionKeyDetails {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::get_dimension_key_details_input::Builder,
}
impl GetDimensionKeyDetails {
/// Creates a new `GetDimensionKeyDetails`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetDimensionKeyDetailsOutput,
aws_smithy_http::result::SdkError<crate::error::GetDimensionKeyDetailsError>,
> {
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The Amazon Web Services service for which Performance Insights returns data. The only valid value is <code>RDS</code>.</p>
pub fn service_type(mut self, input: crate::model::ServiceType) -> Self {
self.inner = self.inner.service_type(input);
self
}
/// <p>The Amazon Web Services service for which Performance Insights returns data. The only valid value is <code>RDS</code>.</p>
pub fn set_service_type(
mut self,
input: std::option::Option<crate::model::ServiceType>,
) -> Self {
self.inner = self.inner.set_service_type(input);
self
}
/// <p>The ID for a data source from which to gather dimension data. This ID must be immutable and unique within an Amazon Web Services Region. When a DB instance is the data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>. </p>
pub fn identifier(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.identifier(input.into());
self
}
/// <p>The ID for a data source from which to gather dimension data. This ID must be immutable and unique within an Amazon Web Services Region. When a DB instance is the data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>. </p>
pub fn set_identifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_identifier(input);
self
}
/// <p>The name of the dimension group. Performance Insights searches the specified group for the dimension group ID. The following group name values are valid:</p>
/// <ul>
/// <li> <p> <code>db.query</code> (Amazon DocumentDB only)</p> </li>
/// <li> <p> <code>db.sql</code> (Amazon RDS and Aurora only)</p> </li>
/// </ul>
pub fn group(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group(input.into());
self
}
/// <p>The name of the dimension group. Performance Insights searches the specified group for the dimension group ID. The following group name values are valid:</p>
/// <ul>
/// <li> <p> <code>db.query</code> (Amazon DocumentDB only)</p> </li>
/// <li> <p> <code>db.sql</code> (Amazon RDS and Aurora only)</p> </li>
/// </ul>
pub fn set_group(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_group(input);
self
}
/// <p>The ID of the dimension group from which to retrieve dimension details. For dimension group <code>db.sql</code>, the group ID is <code>db.sql.id</code>. The following group ID values are valid:</p>
/// <ul>
/// <li> <p> <code>db.sql.id</code> for dimension group <code>db.sql</code> (Aurora and RDS only)</p> </li>
/// <li> <p> <code>db.query.id</code> for dimension group <code>db.query</code> (DocumentDB only)</p> </li>
/// </ul>
pub fn group_identifier(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.group_identifier(input.into());
self
}
/// <p>The ID of the dimension group from which to retrieve dimension details. For dimension group <code>db.sql</code>, the group ID is <code>db.sql.id</code>. The following group ID values are valid:</p>
/// <ul>
/// <li> <p> <code>db.sql.id</code> for dimension group <code>db.sql</code> (Aurora and RDS only)</p> </li>
/// <li> <p> <code>db.query.id</code> for dimension group <code>db.query</code> (DocumentDB only)</p> </li>
/// </ul>
pub fn set_group_identifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_group_identifier(input);
self
}
/// Appends an item to `RequestedDimensions`.
///
/// To override the contents of this collection use [`set_requested_dimensions`](Self::set_requested_dimensions).
///
/// <p>A list of dimensions to retrieve the detail data for within the given dimension group. If you don't specify this parameter, Performance Insights returns all dimension data within the specified dimension group. Specify dimension names for the following dimension groups:</p>
/// <ul>
/// <li> <p> <code>db.sql</code> - Specify either the full dimension name <code>db.sql.statement</code> or the short dimension name <code>statement</code> (Aurora and RDS only).</p> </li>
/// <li> <p> <code>db.query</code> - Specify either the full dimension name <code>db.query.statement</code> or the short dimension name <code>statement</code> (DocumentDB only).</p> </li>
/// </ul>
pub fn requested_dimensions(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.requested_dimensions(input.into());
self
}
/// <p>A list of dimensions to retrieve the detail data for within the given dimension group. If you don't specify this parameter, Performance Insights returns all dimension data within the specified dimension group. Specify dimension names for the following dimension groups:</p>
/// <ul>
/// <li> <p> <code>db.sql</code> - Specify either the full dimension name <code>db.sql.statement</code> or the short dimension name <code>statement</code> (Aurora and RDS only).</p> </li>
/// <li> <p> <code>db.query</code> - Specify either the full dimension name <code>db.query.statement</code> or the short dimension name <code>statement</code> (DocumentDB only).</p> </li>
/// </ul>
pub fn set_requested_dimensions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_requested_dimensions(input);
self
}
}
/// Fluent builder constructing a request to `GetResourceMetadata`.
///
/// <p>Retrieve the metadata for different features. For example, the metadata might indicate that a feature is turned on or off on a specific DB instance. </p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetResourceMetadata {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::get_resource_metadata_input::Builder,
}
impl GetResourceMetadata {
/// Creates a new `GetResourceMetadata`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetResourceMetadataOutput,
aws_smithy_http::result::SdkError<crate::error::GetResourceMetadataError>,
> {
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The Amazon Web Services service for which Performance Insights returns metrics.</p>
pub fn service_type(mut self, input: crate::model::ServiceType) -> Self {
self.inner = self.inner.service_type(input);
self
}
/// <p>The Amazon Web Services service for which Performance Insights returns metrics.</p>
pub fn set_service_type(
mut self,
input: std::option::Option<crate::model::ServiceType>,
) -> Self {
self.inner = self.inner.set_service_type(input);
self
}
/// <p>An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use a DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>. </p>
pub fn identifier(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.identifier(input.into());
self
}
/// <p>An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use a DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>. </p>
pub fn set_identifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_identifier(input);
self
}
}
/// Fluent builder constructing a request to `GetResourceMetrics`.
///
/// <p>Retrieve Performance Insights metrics for a set of data sources over a time period. You can provide specific dimension groups and dimensions, and provide aggregation and filtering criteria for each group.</p> <note>
/// <p>Each response element returns a maximum of 500 bytes. For larger elements, such as SQL statements, only the first 500 bytes are returned.</p>
/// </note>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetResourceMetrics {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::get_resource_metrics_input::Builder,
}
impl GetResourceMetrics {
/// Creates a new `GetResourceMetrics`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetResourceMetricsOutput,
aws_smithy_http::result::SdkError<crate::error::GetResourceMetricsError>,
> {
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::GetResourceMetricsPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::GetResourceMetricsPaginator {
crate::paginator::GetResourceMetricsPaginator::new(self.handle, self.inner)
}
/// <p>The Amazon Web Services service for which Performance Insights returns metrics. Valid values are as follows:</p>
/// <ul>
/// <li> <p> <code>RDS</code> </p> </li>
/// <li> <p> <code>DOCDB</code> </p> </li>
/// </ul>
pub fn service_type(mut self, input: crate::model::ServiceType) -> Self {
self.inner = self.inner.service_type(input);
self
}
/// <p>The Amazon Web Services service for which Performance Insights returns metrics. Valid values are as follows:</p>
/// <ul>
/// <li> <p> <code>RDS</code> </p> </li>
/// <li> <p> <code>DOCDB</code> </p> </li>
/// </ul>
pub fn set_service_type(
mut self,
input: std::option::Option<crate::model::ServiceType>,
) -> Self {
self.inner = self.inner.set_service_type(input);
self
}
/// <p>An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as <i>ResourceID</i>. When you call <code>DescribeDBInstances</code>, the identifier is returned as <code>DbiResourceId</code>.</p>
/// <p>To use a DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>.</p>
pub fn identifier(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.identifier(input.into());
self
}
/// <p>An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as <i>ResourceID</i>. When you call <code>DescribeDBInstances</code>, the identifier is returned as <code>DbiResourceId</code>.</p>
/// <p>To use a DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VW2X</code>.</p>
pub fn set_identifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_identifier(input);
self
}
/// Appends an item to `MetricQueries`.
///
/// To override the contents of this collection use [`set_metric_queries`](Self::set_metric_queries).
///
/// <p>An array of one or more queries to perform. Each query must specify a Performance Insights metric, and can optionally specify aggregation and filtering criteria.</p>
pub fn metric_queries(mut self, input: crate::model::MetricQuery) -> Self {
self.inner = self.inner.metric_queries(input);
self
}
/// <p>An array of one or more queries to perform. Each query must specify a Performance Insights metric, and can optionally specify aggregation and filtering criteria.</p>
pub fn set_metric_queries(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::MetricQuery>>,
) -> Self {
self.inner = self.inner.set_metric_queries(input);
self
}
/// <p>The date and time specifying the beginning of the requested time series query range. You can't specify a <code>StartTime</code> that is earlier than 7 days ago. By default, Performance Insights has 7 days of retention, but you can extend this range up to 2 years. The value specified is <i>inclusive</i>. Thus, the command returns data points equal to or greater than <code>StartTime</code>.</p>
/// <p>The value for <code>StartTime</code> must be earlier than the value for <code>EndTime</code>.</p>
pub fn start_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.start_time(input);
self
}
/// <p>The date and time specifying the beginning of the requested time series query range. You can't specify a <code>StartTime</code> that is earlier than 7 days ago. By default, Performance Insights has 7 days of retention, but you can extend this range up to 2 years. The value specified is <i>inclusive</i>. Thus, the command returns data points equal to or greater than <code>StartTime</code>.</p>
/// <p>The value for <code>StartTime</code> must be earlier than the value for <code>EndTime</code>.</p>
pub fn set_start_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_start_time(input);
self
}
/// <p>The date and time specifying the end of the requested time series query range. The value specified is <i>exclusive</i>. Thus, the command returns data points less than (but not equal to) <code>EndTime</code>.</p>
/// <p>The value for <code>EndTime</code> must be later than the value for <code>StartTime</code>.</p>
pub fn end_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.end_time(input);
self
}
/// <p>The date and time specifying the end of the requested time series query range. The value specified is <i>exclusive</i>. Thus, the command returns data points less than (but not equal to) <code>EndTime</code>.</p>
/// <p>The value for <code>EndTime</code> must be later than the value for <code>StartTime</code>.</p>
pub fn set_end_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_end_time(input);
self
}
/// <p>The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are:</p>
/// <ul>
/// <li> <p> <code>1</code> (one second)</p> </li>
/// <li> <p> <code>60</code> (one minute)</p> </li>
/// <li> <p> <code>300</code> (five minutes)</p> </li>
/// <li> <p> <code>3600</code> (one hour)</p> </li>
/// <li> <p> <code>86400</code> (twenty-four hours)</p> </li>
/// </ul>
/// <p>If you don't specify <code>PeriodInSeconds</code>, then Performance Insights will choose a value for you, with a goal of returning roughly 100-200 data points in the response.</p>
pub fn period_in_seconds(mut self, input: i32) -> Self {
self.inner = self.inner.period_in_seconds(input);
self
}
/// <p>The granularity, in seconds, of the data points returned from Performance Insights. A period can be as short as one second, or as long as one day (86400 seconds). Valid values are:</p>
/// <ul>
/// <li> <p> <code>1</code> (one second)</p> </li>
/// <li> <p> <code>60</code> (one minute)</p> </li>
/// <li> <p> <code>300</code> (five minutes)</p> </li>
/// <li> <p> <code>3600</code> (one hour)</p> </li>
/// <li> <p> <code>86400</code> (twenty-four hours)</p> </li>
/// </ul>
/// <p>If you don't specify <code>PeriodInSeconds</code>, then Performance Insights will choose a value for you, with a goal of returning roughly 100-200 data points in the response.</p>
pub fn set_period_in_seconds(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_period_in_seconds(input);
self
}
/// <p>The maximum number of items to return in the response. If more items exist than the specified <code>MaxRecords</code> value, a pagination token is included in the response so that the remaining results can be retrieved. </p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of items to return in the response. If more items exist than the specified <code>MaxRecords</code> value, a pagination token is included in the response so that the remaining results can be retrieved. </p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
}
/// Fluent builder constructing a request to `ListAvailableResourceDimensions`.
///
/// <p>Retrieve the dimensions that can be queried for each specified metric type on a specified DB instance.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ListAvailableResourceDimensions {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::list_available_resource_dimensions_input::Builder,
}
impl ListAvailableResourceDimensions {
/// Creates a new `ListAvailableResourceDimensions`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListAvailableResourceDimensionsOutput,
aws_smithy_http::result::SdkError<crate::error::ListAvailableResourceDimensionsError>,
> {
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::ListAvailableResourceDimensionsPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::ListAvailableResourceDimensionsPaginator {
crate::paginator::ListAvailableResourceDimensionsPaginator::new(self.handle, self.inner)
}
/// <p>The Amazon Web Services service for which Performance Insights returns metrics.</p>
pub fn service_type(mut self, input: crate::model::ServiceType) -> Self {
self.inner = self.inner.service_type(input);
self
}
/// <p>The Amazon Web Services service for which Performance Insights returns metrics.</p>
pub fn set_service_type(
mut self,
input: std::option::Option<crate::model::ServiceType>,
) -> Self {
self.inner = self.inner.set_service_type(input);
self
}
/// <p>An immutable identifier for a data source that is unique within an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use an Amazon RDS DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VWZ</code>. </p>
pub fn identifier(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.identifier(input.into());
self
}
/// <p>An immutable identifier for a data source that is unique within an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use an Amazon RDS DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VWZ</code>. </p>
pub fn set_identifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_identifier(input);
self
}
/// Appends an item to `Metrics`.
///
/// To override the contents of this collection use [`set_metrics`](Self::set_metrics).
///
/// <p>The types of metrics for which to retrieve dimensions. Valid values include <code>db.load</code>.</p>
pub fn metrics(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.metrics(input.into());
self
}
/// <p>The types of metrics for which to retrieve dimensions. Valid values include <code>db.load</code>.</p>
pub fn set_metrics(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_metrics(input);
self
}
/// <p>The maximum number of items to return in the response. If more items exist than the specified <code>MaxRecords</code> value, a pagination token is included in the response so that the remaining results can be retrieved.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of items to return in the response. If more items exist than the specified <code>MaxRecords</code> value, a pagination token is included in the response so that the remaining results can be retrieved.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>. </p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>. </p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
}
/// Fluent builder constructing a request to `ListAvailableResourceMetrics`.
///
/// <p>Retrieve metrics of the specified types that can be queried for a specified DB instance. </p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ListAvailableResourceMetrics {
handle: std::sync::Arc<super::Handle>,
inner: crate::input::list_available_resource_metrics_input::Builder,
}
impl ListAvailableResourceMetrics {
/// Creates a new `ListAvailableResourceMetrics`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListAvailableResourceMetricsOutput,
aws_smithy_http::result::SdkError<crate::error::ListAvailableResourceMetricsError>,
> {
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::ListAvailableResourceMetricsPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::ListAvailableResourceMetricsPaginator {
crate::paginator::ListAvailableResourceMetricsPaginator::new(self.handle, self.inner)
}
/// <p>The Amazon Web Services service for which Performance Insights returns metrics.</p>
pub fn service_type(mut self, input: crate::model::ServiceType) -> Self {
self.inner = self.inner.service_type(input);
self
}
/// <p>The Amazon Web Services service for which Performance Insights returns metrics.</p>
pub fn set_service_type(
mut self,
input: std::option::Option<crate::model::ServiceType>,
) -> Self {
self.inner = self.inner.set_service_type(input);
self
}
/// <p>An immutable identifier for a data source that is unique within an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use an Amazon RDS DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VWZ</code>. </p>
pub fn identifier(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.identifier(input.into());
self
}
/// <p>An immutable identifier for a data source that is unique within an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use an Amazon RDS DB instance as a data source, specify its <code>DbiResourceId</code> value. For example, specify <code>db-ABCDEFGHIJKLMNOPQRSTU1VWZ</code>. </p>
pub fn set_identifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_identifier(input);
self
}
/// Appends an item to `MetricTypes`.
///
/// To override the contents of this collection use [`set_metric_types`](Self::set_metric_types).
///
/// <p>The types of metrics to return in the response. Valid values in the array include the following:</p>
/// <ul>
/// <li> <p> <code>os</code> (OS counter metrics) - All engines</p> </li>
/// <li> <p> <code>db</code> (DB load metrics) - All engines except for Amazon DocumentDB</p> </li>
/// <li> <p> <code>db.sql.stats</code> (per-SQL metrics) - All engines except for Amazon DocumentDB</p> </li>
/// <li> <p> <code>db.sql_tokenized.stats</code> (per-SQL digest metrics) - All engines except for Amazon DocumentDB</p> </li>
/// </ul>
pub fn metric_types(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.metric_types(input.into());
self
}
/// <p>The types of metrics to return in the response. Valid values in the array include the following:</p>
/// <ul>
/// <li> <p> <code>os</code> (OS counter metrics) - All engines</p> </li>
/// <li> <p> <code>db</code> (DB load metrics) - All engines except for Amazon DocumentDB</p> </li>
/// <li> <p> <code>db.sql.stats</code> (per-SQL metrics) - All engines except for Amazon DocumentDB</p> </li>
/// <li> <p> <code>db.sql_tokenized.stats</code> (per-SQL digest metrics) - All engines except for Amazon DocumentDB</p> </li>
/// </ul>
pub fn set_metric_types(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_metric_types(input);
self
}
/// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>. </p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>MaxRecords</code>. </p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The maximum number of items to return. If the <code>MaxRecords</code> value is less than the number of existing items, the response includes a pagination token. </p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of items to return. If the <code>MaxRecords</code> value is less than the number of existing items, the response includes a pagination token. </p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
}
}
impl Client {
/// Creates a client with the given service config and connector override.
pub fn from_conf_conn<C, E>(conf: crate::Config, conn: C) -> Self
where
C: aws_smithy_client::bounds::SmithyConnector<Error = E> + Send + 'static,
E: Into<aws_smithy_http::result::ConnectorError>,
{
let retry_config = conf.retry_config.as_ref().cloned().unwrap_or_default();
let timeout_config = conf.timeout_config.as_ref().cloned().unwrap_or_default();
let sleep_impl = conf.sleep_impl.clone();
let mut builder = aws_smithy_client::Builder::new()
.connector(aws_smithy_client::erase::DynConnector::new(conn))
.middleware(aws_smithy_client::erase::DynMiddleware::new(
crate::middleware::DefaultMiddleware::new(),
));
builder.set_retry_config(retry_config.into());
builder.set_timeout_config(timeout_config);
if let Some(sleep_impl) = sleep_impl {
builder.set_sleep_impl(Some(sleep_impl));
}
let client = builder.build();
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
/// Creates a new client from a shared config.
#[cfg(any(feature = "rustls", feature = "native-tls"))]
pub fn new(sdk_config: &aws_types::sdk_config::SdkConfig) -> Self {
Self::from_conf(sdk_config.into())
}
/// Creates a new client from the service [`Config`](crate::Config).
#[cfg(any(feature = "rustls", feature = "native-tls"))]
pub fn from_conf(conf: crate::Config) -> Self {
let retry_config = conf.retry_config.as_ref().cloned().unwrap_or_default();
let timeout_config = conf.timeout_config.as_ref().cloned().unwrap_or_default();
let sleep_impl = conf.sleep_impl.clone();
let mut builder = aws_smithy_client::Builder::dyn_https().middleware(
aws_smithy_client::erase::DynMiddleware::new(
crate::middleware::DefaultMiddleware::new(),
),
);
builder.set_retry_config(retry_config.into());
builder.set_timeout_config(timeout_config);
// the builder maintains a try-state. To avoid suppressing the warning when sleep is unset,
// only set it if we actually have a sleep impl.
if let Some(sleep_impl) = sleep_impl {
builder.set_sleep_impl(Some(sleep_impl));
}
let client = builder.build();
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
}