pub struct Client { /* private fields */ }
Expand description
Client for Amazon Prometheus Service
Client for invoking operations on Amazon Prometheus Service. Each operation on Amazon Prometheus Service is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
§Constructing a Client
A Config
is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env()
, since this will resolve an SdkConfig
which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env()
instead, which returns a ConfigLoader
that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_amp::Client::new(&config);
Occasionally, SDKs may have additional service-specific values that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Builder
struct implements From<&SdkConfig>
, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_amp::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();
See the aws-config
docs and Config
for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the CreateAlertManagerDefinition
operation has
a Client::create_alert_manager_definition
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.create_alert_manager_definition()
.workspace_id("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
§Waiters
This client provides wait_until
methods behind the Waiters
trait.
To use them, simply import the trait, and then call one of the wait_until
methods. This will
return a waiter fluent builder that takes various parameters, which are documented on the builder
type. Once parameters have been provided, the wait
method can be called to initiate waiting.
For example, if there was a wait_until_thing
method, it could look like:
let result = client.wait_until_thing()
.thing_id("someId")
.wait(Duration::from_secs(120))
.await;
Implementations§
Source§impl Client
impl Client
Sourcepub fn create_alert_manager_definition(
&self,
) -> CreateAlertManagerDefinitionFluentBuilder
pub fn create_alert_manager_definition( &self, ) -> CreateAlertManagerDefinitionFluentBuilder
Constructs a fluent builder for the CreateAlertManagerDefinition
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace to add the alert manager definition to.
data(Blob)
/set_data(Option<Blob>)
:
required: trueThe alert manager definition to add. A base64-encoded version of the YAML alert manager definition file.
For details about the alert manager definition, see AlertManagedDefinitionData.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.
- On success, responds with
CreateAlertManagerDefinitionOutput
with field(s):status(Option<AlertManagerDefinitionStatus>)
:A structure that displays the current status of the alert manager definition.
- On failure, responds with
SdkError<CreateAlertManagerDefinitionError>
Source§impl Client
impl Client
Sourcepub fn create_logging_configuration(
&self,
) -> CreateLoggingConfigurationFluentBuilder
pub fn create_logging_configuration( &self, ) -> CreateLoggingConfigurationFluentBuilder
Constructs a fluent builder for the CreateLoggingConfiguration
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace to create the logging configuration for.
log_group_arn(impl Into<String>)
/set_log_group_arn(Option<String>)
:
required: trueThe ARN of the CloudWatch log group to which the vended log data will be published. This log group must exist prior to calling this operation.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.
- On success, responds with
CreateLoggingConfigurationOutput
with field(s):status(Option<LoggingConfigurationStatus>)
:A structure that displays the current status of the logging configuration.
- On failure, responds with
SdkError<CreateLoggingConfigurationError>
Source§impl Client
impl Client
Sourcepub fn create_query_logging_configuration(
&self,
) -> CreateQueryLoggingConfigurationFluentBuilder
pub fn create_query_logging_configuration( &self, ) -> CreateQueryLoggingConfigurationFluentBuilder
Constructs a fluent builder for the CreateQueryLoggingConfiguration
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace for which to create the query logging configuration.
destinations(LoggingDestination)
/set_destinations(Option<Vec::<LoggingDestination>>)
:
required: trueThe destinations where query logs will be sent. Only CloudWatch Logs destination is supported. The list must contain exactly one element.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: false(Optional) A unique, case-sensitive identifier that you can provide to ensure the idempotency of the request.
- On success, responds with
CreateQueryLoggingConfigurationOutput
with field(s):status(Option<QueryLoggingConfigurationStatus>)
:The current status of the query logging configuration.
- On failure, responds with
SdkError<CreateQueryLoggingConfigurationError>
Source§impl Client
impl Client
Sourcepub fn create_rule_groups_namespace(
&self,
) -> CreateRuleGroupsNamespaceFluentBuilder
pub fn create_rule_groups_namespace( &self, ) -> CreateRuleGroupsNamespaceFluentBuilder
Constructs a fluent builder for the CreateRuleGroupsNamespace
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace to add the rule groups namespace.
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe name for the new rule groups namespace.
data(Blob)
/set_data(Option<Blob>)
:
required: trueThe rules file to use in the new namespace.
Contains the base64-encoded version of the YAML rules file.
For details about the rule groups namespace structure, see RuleGroupsNamespaceData.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: falseThe list of tag keys and values to associate with the rule groups namespace.
- On success, responds with
CreateRuleGroupsNamespaceOutput
with field(s):name(String)
:The name of the new rule groups namespace.
arn(String)
:The Amazon Resource Name (ARN) of the new rule groups namespace.
status(Option<RuleGroupsNamespaceStatus>)
:A structure that returns the current status of the rule groups namespace.
tags(Option<HashMap::<String, String>>)
:The list of tag keys and values that are associated with the namespace.
- On failure, responds with
SdkError<CreateRuleGroupsNamespaceError>
Source§impl Client
impl Client
Sourcepub fn create_scraper(&self) -> CreateScraperFluentBuilder
pub fn create_scraper(&self) -> CreateScraperFluentBuilder
Constructs a fluent builder for the CreateScraper
operation.
- The fluent builder is configurable:
alias(impl Into<String>)
/set_alias(Option<String>)
:
required: false(optional) An alias to associate with the scraper. This is for your use, and does not need to be unique.
scrape_configuration(ScrapeConfiguration)
/set_scrape_configuration(Option<ScrapeConfiguration>)
:
required: trueThe configuration file to use in the new scraper. For more information, see Scraper configuration in the Amazon Managed Service for Prometheus User Guide.
source(Source)
/set_source(Option<Source>)
:
required: trueThe Amazon EKS cluster from which the scraper will collect metrics.
destination(Destination)
/set_destination(Option<Destination>)
:
required: trueThe Amazon Managed Service for Prometheus workspace to send metrics to.
role_configuration(RoleConfiguration)
/set_role_configuration(Option<RoleConfiguration>)
:
required: falseUse this structure to enable cross-account access, so that you can use a target account to access Prometheus metrics from source accounts.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: false(Optional) A unique, case-sensitive identifier that you can provide to ensure the idempotency of the request.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: false(Optional) The list of tag keys and values to associate with the scraper.
- On success, responds with
CreateScraperOutput
with field(s):scraper_id(String)
:The ID of the new scraper.
arn(String)
:The Amazon Resource Name (ARN) of the new scraper.
status(Option<ScraperStatus>)
:A structure that displays the current status of the scraper.
tags(Option<HashMap::<String, String>>)
:The list of tag keys and values that are associated with the scraper.
- On failure, responds with
SdkError<CreateScraperError>
Source§impl Client
impl Client
Sourcepub fn create_workspace(&self) -> CreateWorkspaceFluentBuilder
pub fn create_workspace(&self) -> CreateWorkspaceFluentBuilder
Constructs a fluent builder for the CreateWorkspace
operation.
- The fluent builder is configurable:
alias(impl Into<String>)
/set_alias(Option<String>)
:
required: falseAn alias that you assign to this workspace to help you identify it. It does not need to be unique.
Blank spaces at the beginning or end of the alias that you specify will be trimmed from the value used.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: falseThe list of tag keys and values to associate with the workspace.
kms_key_arn(impl Into<String>)
/set_kms_key_arn(Option<String>)
:
required: false(optional) The ARN for a customer managed KMS key to use for encrypting data within your workspace. For more information about using your own key in your workspace, see Encryption at rest in the Amazon Managed Service for Prometheus User Guide.
- On success, responds with
CreateWorkspaceOutput
with field(s):workspace_id(String)
:The unique ID for the new workspace.
arn(String)
:The ARN for the new workspace.
status(Option<WorkspaceStatus>)
:The current status of the new workspace. Immediately after you create the workspace, the status is usually
CREATING
.tags(Option<HashMap::<String, String>>)
:The list of tag keys and values that are associated with the workspace.
kms_key_arn(Option<String>)
:(optional) If the workspace was created with a customer managed KMS key, the ARN for the key used.
- On failure, responds with
SdkError<CreateWorkspaceError>
Source§impl Client
impl Client
Sourcepub fn delete_alert_manager_definition(
&self,
) -> DeleteAlertManagerDefinitionFluentBuilder
pub fn delete_alert_manager_definition( &self, ) -> DeleteAlertManagerDefinitionFluentBuilder
Constructs a fluent builder for the DeleteAlertManagerDefinition
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace to delete the alert manager definition from.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.
- On success, responds with
DeleteAlertManagerDefinitionOutput
- On failure, responds with
SdkError<DeleteAlertManagerDefinitionError>
Source§impl Client
impl Client
Sourcepub fn delete_logging_configuration(
&self,
) -> DeleteLoggingConfigurationFluentBuilder
pub fn delete_logging_configuration( &self, ) -> DeleteLoggingConfigurationFluentBuilder
Constructs a fluent builder for the DeleteLoggingConfiguration
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace containing the logging configuration to delete.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.
- On success, responds with
DeleteLoggingConfigurationOutput
- On failure, responds with
SdkError<DeleteLoggingConfigurationError>
Source§impl Client
impl Client
Sourcepub fn delete_query_logging_configuration(
&self,
) -> DeleteQueryLoggingConfigurationFluentBuilder
pub fn delete_query_logging_configuration( &self, ) -> DeleteQueryLoggingConfigurationFluentBuilder
Constructs a fluent builder for the DeleteQueryLoggingConfiguration
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace from which to delete the query logging configuration.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: false(Optional) A unique, case-sensitive identifier that you can provide to ensure the idempotency of the request.
- On success, responds with
DeleteQueryLoggingConfigurationOutput
- On failure, responds with
SdkError<DeleteQueryLoggingConfigurationError>
Source§impl Client
impl Client
Sourcepub fn delete_rule_groups_namespace(
&self,
) -> DeleteRuleGroupsNamespaceFluentBuilder
pub fn delete_rule_groups_namespace( &self, ) -> DeleteRuleGroupsNamespaceFluentBuilder
Constructs a fluent builder for the DeleteRuleGroupsNamespace
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace containing the rule groups namespace and definition to delete.
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe name of the rule groups namespace to delete.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.
- On success, responds with
DeleteRuleGroupsNamespaceOutput
- On failure, responds with
SdkError<DeleteRuleGroupsNamespaceError>
Source§impl Client
impl Client
Sourcepub fn delete_scraper(&self) -> DeleteScraperFluentBuilder
pub fn delete_scraper(&self) -> DeleteScraperFluentBuilder
Constructs a fluent builder for the DeleteScraper
operation.
- The fluent builder is configurable:
scraper_id(impl Into<String>)
/set_scraper_id(Option<String>)
:
required: trueThe ID of the scraper to delete.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: false(Optional) A unique, case-sensitive identifier that you can provide to ensure the idempotency of the request.
- On success, responds with
DeleteScraperOutput
with field(s):scraper_id(String)
:The ID of the scraper to delete.
status(Option<ScraperStatus>)
:The current status of the scraper.
- On failure, responds with
SdkError<DeleteScraperError>
Source§impl Client
impl Client
Sourcepub fn delete_workspace(&self) -> DeleteWorkspaceFluentBuilder
pub fn delete_workspace(&self) -> DeleteWorkspaceFluentBuilder
Constructs a fluent builder for the DeleteWorkspace
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace to delete.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.
- On success, responds with
DeleteWorkspaceOutput
- On failure, responds with
SdkError<DeleteWorkspaceError>
Source§impl Client
impl Client
Sourcepub fn describe_alert_manager_definition(
&self,
) -> DescribeAlertManagerDefinitionFluentBuilder
pub fn describe_alert_manager_definition( &self, ) -> DescribeAlertManagerDefinitionFluentBuilder
Constructs a fluent builder for the DescribeAlertManagerDefinition
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace to retrieve the alert manager definition from.
- On success, responds with
DescribeAlertManagerDefinitionOutput
with field(s):alert_manager_definition(Option<AlertManagerDefinitionDescription>)
:The alert manager definition.
- On failure, responds with
SdkError<DescribeAlertManagerDefinitionError>
Source§impl Client
impl Client
Sourcepub fn describe_logging_configuration(
&self,
) -> DescribeLoggingConfigurationFluentBuilder
pub fn describe_logging_configuration( &self, ) -> DescribeLoggingConfigurationFluentBuilder
Constructs a fluent builder for the DescribeLoggingConfiguration
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace to describe the logging configuration for.
- On success, responds with
DescribeLoggingConfigurationOutput
with field(s):logging_configuration(Option<LoggingConfigurationMetadata>)
:A structure that displays the information about the logging configuration.
- On failure, responds with
SdkError<DescribeLoggingConfigurationError>
Source§impl Client
impl Client
Sourcepub fn describe_query_logging_configuration(
&self,
) -> DescribeQueryLoggingConfigurationFluentBuilder
pub fn describe_query_logging_configuration( &self, ) -> DescribeQueryLoggingConfigurationFluentBuilder
Constructs a fluent builder for the DescribeQueryLoggingConfiguration
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace for which to retrieve the query logging configuration.
- On success, responds with
DescribeQueryLoggingConfigurationOutput
with field(s):query_logging_configuration(Option<QueryLoggingConfigurationMetadata>)
:The detailed information about the query logging configuration for the specified workspace.
- On failure, responds with
SdkError<DescribeQueryLoggingConfigurationError>
Source§impl Client
impl Client
Sourcepub fn describe_rule_groups_namespace(
&self,
) -> DescribeRuleGroupsNamespaceFluentBuilder
pub fn describe_rule_groups_namespace( &self, ) -> DescribeRuleGroupsNamespaceFluentBuilder
Constructs a fluent builder for the DescribeRuleGroupsNamespace
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace containing the rule groups namespace.
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe name of the rule groups namespace that you want information for.
- On success, responds with
DescribeRuleGroupsNamespaceOutput
with field(s):rule_groups_namespace(Option<RuleGroupsNamespaceDescription>)
:The information about the rule groups namespace.
- On failure, responds with
SdkError<DescribeRuleGroupsNamespaceError>
Source§impl Client
impl Client
Sourcepub fn describe_scraper(&self) -> DescribeScraperFluentBuilder
pub fn describe_scraper(&self) -> DescribeScraperFluentBuilder
Constructs a fluent builder for the DescribeScraper
operation.
- The fluent builder is configurable:
scraper_id(impl Into<String>)
/set_scraper_id(Option<String>)
:
required: trueThe ID of the scraper to describe.
- On success, responds with
DescribeScraperOutput
with field(s):scraper(Option<ScraperDescription>)
:Contains details about the scraper.
- On failure, responds with
SdkError<DescribeScraperError>
Source§impl Client
impl Client
Sourcepub fn describe_workspace(&self) -> DescribeWorkspaceFluentBuilder
pub fn describe_workspace(&self) -> DescribeWorkspaceFluentBuilder
Constructs a fluent builder for the DescribeWorkspace
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace to describe.
- On success, responds with
DescribeWorkspaceOutput
with field(s):workspace(Option<WorkspaceDescription>)
:A structure that contains details about the workspace.
- On failure, responds with
SdkError<DescribeWorkspaceError>
Source§impl Client
impl Client
Sourcepub fn describe_workspace_configuration(
&self,
) -> DescribeWorkspaceConfigurationFluentBuilder
pub fn describe_workspace_configuration( &self, ) -> DescribeWorkspaceConfigurationFluentBuilder
Constructs a fluent builder for the DescribeWorkspaceConfiguration
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace that you want to retrieve information for. To find the IDs of your workspaces, use the ListWorkspaces operation.
- On success, responds with
DescribeWorkspaceConfigurationOutput
with field(s):workspace_configuration(Option<WorkspaceConfigurationDescription>)
:This structure contains the information about the workspace configuration.
- On failure, responds with
SdkError<DescribeWorkspaceConfigurationError>
Source§impl Client
impl Client
Sourcepub fn get_default_scraper_configuration(
&self,
) -> GetDefaultScraperConfigurationFluentBuilder
pub fn get_default_scraper_configuration( &self, ) -> GetDefaultScraperConfigurationFluentBuilder
Constructs a fluent builder for the GetDefaultScraperConfiguration
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
GetDefaultScraperConfigurationOutput
with field(s):configuration(Blob)
:The configuration file. Base 64 encoded. For more information, see Scraper configurationin the Amazon Managed Service for Prometheus User Guide.
- On failure, responds with
SdkError<GetDefaultScraperConfigurationError>
Source§impl Client
impl Client
Sourcepub fn list_rule_groups_namespaces(
&self,
) -> ListRuleGroupsNamespacesFluentBuilder
pub fn list_rule_groups_namespaces( &self, ) -> ListRuleGroupsNamespacesFluentBuilder
Constructs a fluent builder for the ListRuleGroupsNamespaces
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace containing the rule groups namespaces.
name(impl Into<String>)
/set_name(Option<String>)
:
required: falseUse this parameter to filter the rule groups namespaces that are returned. Only the namespaces with names that begin with the value that you specify are returned.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token for the next set of items to return. You receive this token from a previous call, and use it to get the next page of results. The other parameters must be the same as the initial call.
For example, if your initial request has
maxResults
of 10, and there are 12 rule groups namespaces to return, then your initial request will return 10 and anextToken
. Using the next token in a subsequent call will return the remaining 2 namespaces.max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return. The default is 100.
- On success, responds with
ListRuleGroupsNamespacesOutput
with field(s):rule_groups_namespaces(Vec::<RuleGroupsNamespaceSummary>)
:The returned list of rule groups namespaces.
next_token(Option<String>)
:A token indicating that there are more results to retrieve. You can use this token as part of your next
ListRuleGroupsNamespaces
request to retrieve those results.
- On failure, responds with
SdkError<ListRuleGroupsNamespacesError>
Source§impl Client
impl Client
Sourcepub fn list_scrapers(&self) -> ListScrapersFluentBuilder
pub fn list_scrapers(&self) -> ListScrapersFluentBuilder
Constructs a fluent builder for the ListScrapers
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
filters(impl Into<String>, Vec::<String>)
/set_filters(Option<HashMap::<String, Vec::<String>>>)
:
required: false(Optional) A list of key-value pairs to filter the list of scrapers returned. Keys include
status
,sourceArn
,destinationArn
, andalias
.Filters on the same key are
OR
’d together, and filters on different keys areAND
’d together. For example,status=ACTIVE&status=CREATING&alias=Test
, will return all scrapers that have the alias Test, and are either in status ACTIVE or CREATING.To find all active scrapers that are sending metrics to a specific Amazon Managed Service for Prometheus workspace, you would use the ARN of the workspace in a query:
status=ACTIVE&destinationArn=arn:aws:aps:us-east-1:123456789012:workspace/ws-example1-1234-abcd-56ef-123456789012
If this is included, it filters the results to only the scrapers that match the filter.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: false(Optional) The token for the next set of items to return. (You received this token from a previous call.)
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseOptional) The maximum number of scrapers to return in one
ListScrapers
operation. The range is 1-1000.If you omit this parameter, the default of 100 is used.
- On success, responds with
ListScrapersOutput
with field(s):scrapers(Vec::<ScraperSummary>)
:A list of
ScraperSummary
structures giving information about scrapers in the account that match the filters provided.next_token(Option<String>)
:A token indicating that there are more results to retrieve. You can use this token as part of your next
ListScrapers
operation to retrieve those results.
- On failure, responds with
SdkError<ListScrapersError>
Source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe ARN of the resource to list tages for. Must be a workspace, scraper, or rule groups namespace resource.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<HashMap::<String, String>>)
:The list of tag keys and values associated with the resource.
- On failure, responds with
SdkError<ListTagsForResourceError>
Source§impl Client
impl Client
Sourcepub fn list_workspaces(&self) -> ListWorkspacesFluentBuilder
pub fn list_workspaces(&self) -> ListWorkspacesFluentBuilder
Constructs a fluent builder for the ListWorkspaces
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token for the next set of items to return. You receive this token from a previous call, and use it to get the next page of results. The other parameters must be the same as the initial call.
For example, if your initial request has
maxResults
of 10, and there are 12 workspaces to return, then your initial request will return 10 and anextToken
. Using the next token in a subsequent call will return the remaining 2 workspaces.alias(impl Into<String>)
/set_alias(Option<String>)
:
required: falseIf this is included, it filters the results to only the workspaces with names that start with the value that you specify here.
Amazon Managed Service for Prometheus will automatically strip any blank spaces from the beginning and end of the alias that you specify.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of workspaces to return per request. The default is 100.
- On success, responds with
ListWorkspacesOutput
with field(s):workspaces(Vec::<WorkspaceSummary>)
:An array of
WorkspaceSummary
structures containing information about the workspaces requested.next_token(Option<String>)
:A token indicating that there are more results to retrieve. You can use this token as part of your next
ListWorkspaces
request to retrieve those results.
- On failure, responds with
SdkError<ListWorkspacesError>
Source§impl Client
impl Client
Sourcepub fn put_alert_manager_definition(
&self,
) -> PutAlertManagerDefinitionFluentBuilder
pub fn put_alert_manager_definition( &self, ) -> PutAlertManagerDefinitionFluentBuilder
Constructs a fluent builder for the PutAlertManagerDefinition
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace to update the alert manager definition in.
data(Blob)
/set_data(Option<Blob>)
:
required: trueThe alert manager definition to use. A base64-encoded version of the YAML alert manager definition file.
For details about the alert manager definition, see AlertManagedDefinitionData.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.
- On success, responds with
PutAlertManagerDefinitionOutput
with field(s):status(Option<AlertManagerDefinitionStatus>)
:A structure that returns the current status of the alert manager definition.
- On failure, responds with
SdkError<PutAlertManagerDefinitionError>
Source§impl Client
impl Client
Sourcepub fn put_rule_groups_namespace(&self) -> PutRuleGroupsNamespaceFluentBuilder
pub fn put_rule_groups_namespace(&self) -> PutRuleGroupsNamespaceFluentBuilder
Constructs a fluent builder for the PutRuleGroupsNamespace
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace where you are updating the rule groups namespace.
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe name of the rule groups namespace that you are updating.
data(Blob)
/set_data(Option<Blob>)
:
required: trueThe new rules file to use in the namespace. A base64-encoded version of the YAML rule groups file.
For details about the rule groups namespace structure, see RuleGroupsNamespaceData.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.
- On success, responds with
PutRuleGroupsNamespaceOutput
with field(s):name(String)
:The name of the rule groups namespace that was updated.
arn(String)
:The ARN of the rule groups namespace.
status(Option<RuleGroupsNamespaceStatus>)
:A structure that includes the current status of the rule groups namespace.
tags(Option<HashMap::<String, String>>)
:The list of tag keys and values that are associated with the namespace.
- On failure, responds with
SdkError<PutRuleGroupsNamespaceError>
Source§impl Client
impl Client
Sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe ARN of the resource to apply tags to.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: trueThe list of tag keys and values to associate with the resource.
Keys must not begin with
aws:
.
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
Source§impl Client
impl Client
Sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe ARN of the resource from which to remove a tag.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueThe keys of the tags to remove.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
Source§impl Client
impl Client
Sourcepub fn update_logging_configuration(
&self,
) -> UpdateLoggingConfigurationFluentBuilder
pub fn update_logging_configuration( &self, ) -> UpdateLoggingConfigurationFluentBuilder
Constructs a fluent builder for the UpdateLoggingConfiguration
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace to update the logging configuration for.
log_group_arn(impl Into<String>)
/set_log_group_arn(Option<String>)
:
required: trueThe ARN of the CloudWatch log group to which the vended log data will be published.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.
- On success, responds with
UpdateLoggingConfigurationOutput
with field(s):status(Option<LoggingConfigurationStatus>)
:A structure that contains the current status of the logging configuration.
- On failure, responds with
SdkError<UpdateLoggingConfigurationError>
Source§impl Client
impl Client
Sourcepub fn update_query_logging_configuration(
&self,
) -> UpdateQueryLoggingConfigurationFluentBuilder
pub fn update_query_logging_configuration( &self, ) -> UpdateQueryLoggingConfigurationFluentBuilder
Constructs a fluent builder for the UpdateQueryLoggingConfiguration
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace for which to update the query logging configuration.
destinations(LoggingDestination)
/set_destinations(Option<Vec::<LoggingDestination>>)
:
required: trueThe destinations where query logs will be sent. Only CloudWatch Logs destination is supported. The list must contain exactly one element.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: false(Optional) A unique, case-sensitive identifier that you can provide to ensure the idempotency of the request.
- On success, responds with
UpdateQueryLoggingConfigurationOutput
with field(s):status(Option<QueryLoggingConfigurationStatus>)
:The current status of the query logging configuration.
- On failure, responds with
SdkError<UpdateQueryLoggingConfigurationError>
Source§impl Client
impl Client
Sourcepub fn update_scraper(&self) -> UpdateScraperFluentBuilder
pub fn update_scraper(&self) -> UpdateScraperFluentBuilder
Constructs a fluent builder for the UpdateScraper
operation.
- The fluent builder is configurable:
scraper_id(impl Into<String>)
/set_scraper_id(Option<String>)
:
required: trueThe ID of the scraper to update.
alias(impl Into<String>)
/set_alias(Option<String>)
:
required: falseThe new alias of the scraper.
scrape_configuration(ScrapeConfiguration)
/set_scrape_configuration(Option<ScrapeConfiguration>)
:
required: falseContains the base-64 encoded YAML configuration for the scraper.
For more information about configuring a scraper, see Using an Amazon Web Services managed collector in the Amazon Managed Service for Prometheus User Guide.
destination(Destination)
/set_destination(Option<Destination>)
:
required: falseThe new Amazon Managed Service for Prometheus workspace to send metrics to.
role_configuration(RoleConfiguration)
/set_role_configuration(Option<RoleConfiguration>)
:
required: falseUse this structure to enable cross-account access, so that you can use a target account to access Prometheus metrics from source accounts.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.
- On success, responds with
UpdateScraperOutput
with field(s):scraper_id(String)
:The ID of the updated scraper.
arn(String)
:The Amazon Resource Name (ARN) of the updated scraper.
status(Option<ScraperStatus>)
:A structure that displays the current status of the scraper.
tags(Option<HashMap::<String, String>>)
:The list of tag keys and values that are associated with the scraper.
- On failure, responds with
SdkError<UpdateScraperError>
Source§impl Client
impl Client
Sourcepub fn update_workspace_alias(&self) -> UpdateWorkspaceAliasFluentBuilder
pub fn update_workspace_alias(&self) -> UpdateWorkspaceAliasFluentBuilder
Constructs a fluent builder for the UpdateWorkspaceAlias
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace to update.
alias(impl Into<String>)
/set_alias(Option<String>)
:
required: falseThe new alias for the workspace. It does not need to be unique.
Amazon Managed Service for Prometheus will automatically strip any blank spaces from the beginning and end of the alias that you specify.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.
- On success, responds with
UpdateWorkspaceAliasOutput
- On failure, responds with
SdkError<UpdateWorkspaceAliasError>
Source§impl Client
impl Client
Sourcepub fn update_workspace_configuration(
&self,
) -> UpdateWorkspaceConfigurationFluentBuilder
pub fn update_workspace_configuration( &self, ) -> UpdateWorkspaceConfigurationFluentBuilder
Constructs a fluent builder for the UpdateWorkspaceConfiguration
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:
required: trueThe ID of the workspace that you want to update. To find the IDs of your workspaces, use the ListWorkspaces operation.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseYou can include a token in your operation to make it an idempotent opeartion.
limits_per_label_set(LimitsPerLabelSet)
/set_limits_per_label_set(Option<Vec::<LimitsPerLabelSet>>)
:
required: falseThis is an array of structures, where each structure defines a label set for the workspace, and defines the active time series limit for each of those label sets. Each label name in a label set must be unique.
retention_period_in_days(i32)
/set_retention_period_in_days(Option<i32>)
:
required: falseSpecifies how many days that metrics will be retained in the workspace.
- On success, responds with
UpdateWorkspaceConfigurationOutput
with field(s):status(Option<WorkspaceConfigurationStatus>)
:The status of the workspace configuration.
- On failure, responds with
SdkError<UpdateWorkspaceConfigurationError>
Source§impl Client
impl Client
Sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
Source§impl Client
impl Client
Sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
Source§impl Waiters for Client
impl Waiters for Client
Source§fn wait_until_scraper_active(&self) -> ScraperActiveFluentBuilder
fn wait_until_scraper_active(&self) -> ScraperActiveFluentBuilder
Source§fn wait_until_scraper_deleted(&self) -> ScraperDeletedFluentBuilder
fn wait_until_scraper_deleted(&self) -> ScraperDeletedFluentBuilder
Source§fn wait_until_workspace_active(&self) -> WorkspaceActiveFluentBuilder
fn wait_until_workspace_active(&self) -> WorkspaceActiveFluentBuilder
Source§fn wait_until_workspace_deleted(&self) -> WorkspaceDeletedFluentBuilder
fn wait_until_workspace_deleted(&self) -> WorkspaceDeletedFluentBuilder
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);