Struct aws_sdk_osis::client::Client
source · pub struct Client { /* private fields */ }
Expand description
Client for Amazon OpenSearch Ingestion
Client for invoking operations on Amazon OpenSearch Ingestion. Each operation on Amazon OpenSearch Ingestion 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_osis::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 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_osis::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 CreatePipeline
operation has
a Client::create_pipeline
, 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_pipeline()
.pipeline_name("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_pipeline(&self) -> CreatePipelineFluentBuilder
pub fn create_pipeline(&self) -> CreatePipelineFluentBuilder
Constructs a fluent builder for the CreatePipeline
operation.
- The fluent builder is configurable:
pipeline_name(impl Into<String>)
/set_pipeline_name(Option<String>)
:
required: trueThe name of the OpenSearch Ingestion pipeline to create. Pipeline names are unique across the pipelines owned by an account within an Amazon Web Services Region.
min_units(i32)
/set_min_units(Option<i32>)
:
required: trueThe minimum pipeline capacity, in Ingestion Compute Units (ICUs).
max_units(i32)
/set_max_units(Option<i32>)
:
required: trueThe maximum pipeline capacity, in Ingestion Compute Units (ICUs).
pipeline_configuration_body(impl Into<String>)
/set_pipeline_configuration_body(Option<String>)
:
required: trueThe pipeline configuration in YAML format. The command accepts the pipeline configuration as a string or within a .yaml file. If you provide the configuration as a string, each new line must be escaped with
\n
.log_publishing_options(LogPublishingOptions)
/set_log_publishing_options(Option<LogPublishingOptions>)
:
required: falseKey-value pairs to configure log publishing.
vpc_options(VpcOptions)
/set_vpc_options(Option<VpcOptions>)
:
required: falseContainer for the values required to configure VPC access for the pipeline. If you don’t specify these values, OpenSearch Ingestion creates the pipeline with a public endpoint.
buffer_options(BufferOptions)
/set_buffer_options(Option<BufferOptions>)
:
required: falseKey-value pairs to configure persistent buffering for the pipeline.
encryption_at_rest_options(EncryptionAtRestOptions)
/set_encryption_at_rest_options(Option<EncryptionAtRestOptions>)
:
required: falseKey-value pairs to configure encryption for data that is written to a persistent buffer.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: falseList of tags to add to the pipeline upon creation.
- On success, responds with
CreatePipelineOutput
with field(s):pipeline(Option<Pipeline>)
:Container for information about the created pipeline.
- On failure, responds with
SdkError<CreatePipelineError>
source§impl Client
impl Client
sourcepub fn delete_pipeline(&self) -> DeletePipelineFluentBuilder
pub fn delete_pipeline(&self) -> DeletePipelineFluentBuilder
Constructs a fluent builder for the DeletePipeline
operation.
- The fluent builder is configurable:
pipeline_name(impl Into<String>)
/set_pipeline_name(Option<String>)
:
required: trueThe name of the pipeline to delete.
- On success, responds with
DeletePipelineOutput
- On failure, responds with
SdkError<DeletePipelineError>
source§impl Client
impl Client
sourcepub fn get_pipeline(&self) -> GetPipelineFluentBuilder
pub fn get_pipeline(&self) -> GetPipelineFluentBuilder
Constructs a fluent builder for the GetPipeline
operation.
- The fluent builder is configurable:
pipeline_name(impl Into<String>)
/set_pipeline_name(Option<String>)
:
required: trueThe name of the pipeline to get information about.
- On success, responds with
GetPipelineOutput
with field(s):pipeline(Option<Pipeline>)
:Detailed information about the requested pipeline.
- On failure, responds with
SdkError<GetPipelineError>
source§impl Client
impl Client
sourcepub fn get_pipeline_blueprint(&self) -> GetPipelineBlueprintFluentBuilder
pub fn get_pipeline_blueprint(&self) -> GetPipelineBlueprintFluentBuilder
Constructs a fluent builder for the GetPipelineBlueprint
operation.
- The fluent builder is configurable:
blueprint_name(impl Into<String>)
/set_blueprint_name(Option<String>)
:
required: trueThe name of the blueprint to retrieve.
- On success, responds with
GetPipelineBlueprintOutput
with field(s):blueprint(Option<PipelineBlueprint>)
:The requested blueprint in YAML format.
- On failure, responds with
SdkError<GetPipelineBlueprintError>
source§impl Client
impl Client
sourcepub fn get_pipeline_change_progress(
&self
) -> GetPipelineChangeProgressFluentBuilder
pub fn get_pipeline_change_progress( &self ) -> GetPipelineChangeProgressFluentBuilder
Constructs a fluent builder for the GetPipelineChangeProgress
operation.
- The fluent builder is configurable:
pipeline_name(impl Into<String>)
/set_pipeline_name(Option<String>)
:
required: trueThe name of the pipeline.
- On success, responds with
GetPipelineChangeProgressOutput
with field(s):change_progress_statuses(Option<Vec::<ChangeProgressStatus>>)
:The current status of the change happening on the pipeline.
- On failure, responds with
SdkError<GetPipelineChangeProgressError>
source§impl Client
impl Client
sourcepub fn list_pipeline_blueprints(&self) -> ListPipelineBlueprintsFluentBuilder
pub fn list_pipeline_blueprints(&self) -> ListPipelineBlueprintsFluentBuilder
Constructs a fluent builder for the ListPipelineBlueprints
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
ListPipelineBlueprintsOutput
with field(s):blueprints(Option<Vec::<PipelineBlueprintSummary>>)
:A list of available blueprints for Data Prepper.
- On failure, responds with
SdkError<ListPipelineBlueprintsError>
source§impl Client
impl Client
sourcepub fn list_pipelines(&self) -> ListPipelinesFluentBuilder
pub fn list_pipelines(&self) -> ListPipelinesFluentBuilder
Constructs a fluent builder for the ListPipelines
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseAn optional parameter that specifies the maximum number of results to return. You can use
nextToken
to get the next page of results.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseIf your initial
ListPipelines
operation returns anextToken
, you can include the returnednextToken
in subsequentListPipelines
operations, which returns results in the next page.
- On success, responds with
ListPipelinesOutput
with field(s):next_token(Option<String>)
:When
nextToken
is returned, there are more results available. The value ofnextToken
is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page.pipelines(Option<Vec::<PipelineSummary>>)
:A list of all existing Data Prepper pipelines.
- On failure, responds with
SdkError<ListPipelinesError>
source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
arn(impl Into<String>)
/set_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the pipeline to retrieve tags for.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<Vec::<Tag>>)
:A list of tags associated with the given pipeline.
- On failure, responds with
SdkError<ListTagsForResourceError>
source§impl Client
impl Client
sourcepub fn start_pipeline(&self) -> StartPipelineFluentBuilder
pub fn start_pipeline(&self) -> StartPipelineFluentBuilder
Constructs a fluent builder for the StartPipeline
operation.
- The fluent builder is configurable:
pipeline_name(impl Into<String>)
/set_pipeline_name(Option<String>)
:
required: trueThe name of the pipeline to start.
- On success, responds with
StartPipelineOutput
with field(s):pipeline(Option<Pipeline>)
:Information about an existing OpenSearch Ingestion pipeline.
- On failure, responds with
SdkError<StartPipelineError>
source§impl Client
impl Client
sourcepub fn stop_pipeline(&self) -> StopPipelineFluentBuilder
pub fn stop_pipeline(&self) -> StopPipelineFluentBuilder
Constructs a fluent builder for the StopPipeline
operation.
- The fluent builder is configurable:
pipeline_name(impl Into<String>)
/set_pipeline_name(Option<String>)
:
required: trueThe name of the pipeline to stop.
- On success, responds with
StopPipelineOutput
with field(s):pipeline(Option<Pipeline>)
:Information about an existing OpenSearch Ingestion pipeline.
- On failure, responds with
SdkError<StopPipelineError>
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:
arn(impl Into<String>)
/set_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the pipeline to tag.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: trueThe list of key-value tags to add to the pipeline.
- 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:
arn(impl Into<String>)
/set_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the pipeline to remove tags from.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueThe tag keys to remove.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
source§impl Client
impl Client
sourcepub fn update_pipeline(&self) -> UpdatePipelineFluentBuilder
pub fn update_pipeline(&self) -> UpdatePipelineFluentBuilder
Constructs a fluent builder for the UpdatePipeline
operation.
- The fluent builder is configurable:
pipeline_name(impl Into<String>)
/set_pipeline_name(Option<String>)
:
required: trueThe name of the pipeline to update.
min_units(i32)
/set_min_units(Option<i32>)
:
required: falseThe minimum pipeline capacity, in Ingestion Compute Units (ICUs).
max_units(i32)
/set_max_units(Option<i32>)
:
required: falseThe maximum pipeline capacity, in Ingestion Compute Units (ICUs)
pipeline_configuration_body(impl Into<String>)
/set_pipeline_configuration_body(Option<String>)
:
required: falseThe pipeline configuration in YAML format. The command accepts the pipeline configuration as a string or within a .yaml file. If you provide the configuration as a string, each new line must be escaped with
\n
.log_publishing_options(LogPublishingOptions)
/set_log_publishing_options(Option<LogPublishingOptions>)
:
required: falseKey-value pairs to configure log publishing.
buffer_options(BufferOptions)
/set_buffer_options(Option<BufferOptions>)
:
required: falseKey-value pairs to configure persistent buffering for the pipeline.
encryption_at_rest_options(EncryptionAtRestOptions)
/set_encryption_at_rest_options(Option<EncryptionAtRestOptions>)
:
required: falseKey-value pairs to configure encryption for data that is written to a persistent buffer.
- On success, responds with
UpdatePipelineOutput
with field(s):pipeline(Option<Pipeline>)
:Container for information about the updated pipeline.
- On failure, responds with
SdkError<UpdatePipelineError>
source§impl Client
impl Client
sourcepub fn validate_pipeline(&self) -> ValidatePipelineFluentBuilder
pub fn validate_pipeline(&self) -> ValidatePipelineFluentBuilder
Constructs a fluent builder for the ValidatePipeline
operation.
- The fluent builder is configurable:
pipeline_configuration_body(impl Into<String>)
/set_pipeline_configuration_body(Option<String>)
:
required: trueThe pipeline configuration in YAML format. The command accepts the pipeline configuration as a string or within a .yaml file. If you provide the configuration as a string, each new line must be escaped with
\n
.
- On success, responds with
ValidatePipelineOutput
with field(s):is_valid(Option<bool>)
:A boolean indicating whether or not the pipeline configuration is valid.
errors(Option<Vec::<ValidationMessage>>)
:A list of errors if the configuration is invalid.
- On failure, responds with
SdkError<ValidatePipelineError>
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§
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> 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 more