Struct aws_sdk_amp::Client
source · 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 that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Config
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 ListTagsForResource
operation has
a Client::list_tags_for_resource
, 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.list_tags_for_resource()
.resource_arn("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.
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 ::std::convert::Into<String>)
/set_workspace_id(Option<String>)
: The ID of the workspace in which to create the alert manager definition.data(Blob)
/set_data(Option<Blob>)
: The alert manager definition data.client_token(impl ::std::convert::Into<String>)
/set_client_token(Option<String>)
: Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.
- On success, responds with
CreateAlertManagerDefinitionOutput
with field(s):status(Option<AlertManagerDefinitionStatus>)
: The status of 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 ::std::convert::Into<String>)
/set_workspace_id(Option<String>)
: The ID of the workspace to vend logs to.log_group_arn(impl ::std::convert::Into<String>)
/set_log_group_arn(Option<String>)
: The ARN of the CW log group to which the vended log data will be published.client_token(impl ::std::convert::Into<String>)
/set_client_token(Option<String>)
: Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.
- On success, responds with
CreateLoggingConfigurationOutput
with field(s):status(Option<LoggingConfigurationStatus>)
: The status of the logging configuration.
- On failure, responds with
SdkError<CreateLoggingConfigurationError>
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 ::std::convert::Into<String>)
/set_workspace_id(Option<String>)
: The ID of the workspace in which to create the rule group namespace.name(impl ::std::convert::Into<String>)
/set_name(Option<String>)
: The rule groups namespace name.data(Blob)
/set_data(Option<Blob>)
: The namespace data that define the rule groups.client_token(impl ::std::convert::Into<String>)
/set_client_token(Option<String>)
: Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.tags(HashMap<String, String>)
/set_tags(Option<HashMap<String, String>>)
: Optional, user-provided tags for this rule groups namespace.
- On success, responds with
CreateRuleGroupsNamespaceOutput
with field(s):name(Option<String>)
: The rule groups namespace name.arn(Option<String>)
: The Amazon Resource Name (ARN) of this rule groups namespace.status(Option<RuleGroupsNamespaceStatus>)
: The status of rule groups namespace.tags(Option<HashMap<String, String>>)
: The tags of this rule groups namespace.
- On failure, responds with
SdkError<CreateRuleGroupsNamespaceError>
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 ::std::convert::Into<String>)
/set_alias(Option<String>)
: An optional user-assigned alias for this workspace. This alias is for user reference and does not need to be unique.client_token(impl ::std::convert::Into<String>)
/set_client_token(Option<String>)
: Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.tags(HashMap<String, String>)
/set_tags(Option<HashMap<String, String>>)
: Optional, user-provided tags for this workspace.
- On success, responds with
CreateWorkspaceOutput
with field(s):workspace_id(Option<String>)
: The generated ID of the workspace that was just created.arn(Option<String>)
: The ARN of the workspace that was just created.status(Option<WorkspaceStatus>)
: The status of the workspace that was just created (usually CREATING).tags(Option<HashMap<String, String>>)
: The tags of this workspace.
- 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 ::std::convert::Into<String>)
/set_workspace_id(Option<String>)
: The ID of the workspace in which to delete the alert manager definition.client_token(impl ::std::convert::Into<String>)
/set_client_token(Option<String>)
: Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.
- 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 ::std::convert::Into<String>)
/set_workspace_id(Option<String>)
: The ID of the workspace to vend logs to.client_token(impl ::std::convert::Into<String>)
/set_client_token(Option<String>)
: Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.
- On success, responds with
DeleteLoggingConfigurationOutput
- On failure, responds with
SdkError<DeleteLoggingConfigurationError>
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 ::std::convert::Into<String>)
/set_workspace_id(Option<String>)
: The ID of the workspace to delete rule group definition.name(impl ::std::convert::Into<String>)
/set_name(Option<String>)
: The rule groups namespace name.client_token(impl ::std::convert::Into<String>)
/set_client_token(Option<String>)
: Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.
- On success, responds with
DeleteRuleGroupsNamespaceOutput
- On failure, responds with
SdkError<DeleteRuleGroupsNamespaceError>
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 ::std::convert::Into<String>)
/set_workspace_id(Option<String>)
: The ID of the workspace to delete.client_token(impl ::std::convert::Into<String>)
/set_client_token(Option<String>)
: Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.
- 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 ::std::convert::Into<String>)
/set_workspace_id(Option<String>)
: The ID of the workspace to describe.
- On success, responds with
DescribeAlertManagerDefinitionOutput
with field(s):alert_manager_definition(Option<AlertManagerDefinitionDescription>)
: The properties of the selected workspace’s 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 ::std::convert::Into<String>)
/set_workspace_id(Option<String>)
: The ID of the workspace to vend logs to.
- On success, responds with
DescribeLoggingConfigurationOutput
with field(s):logging_configuration(Option<LoggingConfigurationMetadata>)
: Metadata object containing information about the logging configuration of a workspace.
- On failure, responds with
SdkError<DescribeLoggingConfigurationError>
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 ::std::convert::Into<String>)
/set_workspace_id(Option<String>)
: The ID of the workspace to describe.name(impl ::std::convert::Into<String>)
/set_name(Option<String>)
: The rule groups namespace.
- On success, responds with
DescribeRuleGroupsNamespaceOutput
with field(s):rule_groups_namespace(Option<RuleGroupsNamespaceDescription>)
: The selected rule groups namespace.
- On failure, responds with
SdkError<DescribeRuleGroupsNamespaceError>
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 ::std::convert::Into<String>)
/set_workspace_id(Option<String>)
: The ID of the workspace to describe.
- On success, responds with
DescribeWorkspaceOutput
with field(s):workspace(Option<WorkspaceDescription>)
: The properties of the selected workspace.
- On failure, responds with
SdkError<DescribeWorkspaceError>
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 ::std::convert::Into<String>)
/set_workspace_id(Option<String>)
: The ID of the workspace.name(impl ::std::convert::Into<String>)
/set_name(Option<String>)
: Optional filter for rule groups namespace name. Only the rule groups namespace that begin with this value will be returned.next_token(impl ::std::convert::Into<String>)
/set_next_token(Option<String>)
: Pagination token to request the next page in a paginated list. This token is obtained from the output of the previous ListRuleGroupsNamespaces request.max_results(i32)
/set_max_results(Option<i32>)
: Maximum results to return in response (default=100, maximum=1000).
- On success, responds with
ListRuleGroupsNamespacesOutput
with field(s):rule_groups_namespaces(Option<Vec<RuleGroupsNamespaceSummary>>)
: The list of the selected rule groups namespaces.next_token(Option<String>)
: Pagination token to use when requesting the next page in this list.
- On failure, responds with
SdkError<ListRuleGroupsNamespacesError>
source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl ::std::convert::Into<String>)
/set_resource_arn(Option<String>)
: The ARN of the resource.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<HashMap<String, String>>)
: The list of tags assigned to 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 ::std::convert::Into<String>)
/set_next_token(Option<String>)
: Pagination token to request the next page in a paginated list. This token is obtained from the output of the previous ListWorkspaces request.alias(impl ::std::convert::Into<String>)
/set_alias(Option<String>)
: Optional filter for workspace alias. Only the workspaces with aliases that begin with this value will be returned.max_results(i32)
/set_max_results(Option<i32>)
: Maximum results to return in response (default=100, maximum=1000).
- On success, responds with
ListWorkspacesOutput
with field(s):workspaces(Option<Vec<WorkspaceSummary>>)
: The list of existing workspaces, including those undergoing creation or deletion.next_token(Option<String>)
: Pagination token to use when requesting the next page in this list.
- 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 ::std::convert::Into<String>)
/set_workspace_id(Option<String>)
: The ID of the workspace in which to update the alert manager definition.data(Blob)
/set_data(Option<Blob>)
: The alert manager definition data.client_token(impl ::std::convert::Into<String>)
/set_client_token(Option<String>)
: Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.
- On success, responds with
PutAlertManagerDefinitionOutput
with field(s):status(Option<AlertManagerDefinitionStatus>)
: The status of 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 ::std::convert::Into<String>)
/set_workspace_id(Option<String>)
: The ID of the workspace in which to update the rule group namespace.name(impl ::std::convert::Into<String>)
/set_name(Option<String>)
: The rule groups namespace name.data(Blob)
/set_data(Option<Blob>)
: The namespace data that define the rule groups.client_token(impl ::std::convert::Into<String>)
/set_client_token(Option<String>)
: Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.
- On success, responds with
PutRuleGroupsNamespaceOutput
with field(s):name(Option<String>)
: The rule groups namespace name.arn(Option<String>)
: The Amazon Resource Name (ARN) of this rule groups namespace.status(Option<RuleGroupsNamespaceStatus>)
: The status of rule groups namespace.tags(Option<HashMap<String, String>>)
: The tags of this rule groups 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 ::std::convert::Into<String>)
/set_resource_arn(Option<String>)
: The ARN of the resource.tags(HashMap<String, String>)
/set_tags(Option<HashMap<String, String>>)
: The list of tags assigned to the resource.
- 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 ::std::convert::Into<String>)
/set_resource_arn(Option<String>)
: The ARN of the resource.tag_keys(Vec<String>)
/set_tag_keys(Option<Vec<String>>)
: One or more tag keys
- 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 ::std::convert::Into<String>)
/set_workspace_id(Option<String>)
: The ID of the workspace to vend logs to.log_group_arn(impl ::std::convert::Into<String>)
/set_log_group_arn(Option<String>)
: The ARN of the CW log group to which the vended log data will be published.client_token(impl ::std::convert::Into<String>)
/set_client_token(Option<String>)
: Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.
- On success, responds with
UpdateLoggingConfigurationOutput
with field(s):status(Option<LoggingConfigurationStatus>)
: The status of the logging configuration.
- On failure, responds with
SdkError<UpdateLoggingConfigurationError>
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 ::std::convert::Into<String>)
/set_workspace_id(Option<String>)
: The ID of the workspace being updated.alias(impl ::std::convert::Into<String>)
/set_alias(Option<String>)
: The new alias of the workspace.client_token(impl ::std::convert::Into<String>)
/set_client_token(Option<String>)
: Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.
- On success, responds with
UpdateWorkspaceAliasOutput
- On failure, responds with
SdkError<UpdateWorkspaceAliasError>
source§impl Client
impl Client
sourcepub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
pub fn with_config( client: Client<DynConnector, DynMiddleware<DynConnector>>, conf: Config ) -> Self
Creates a client with the given service configuration.
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.
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 if the
conf
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
conf
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it.