pub struct HttpCheck {
Show 14 fields pub request_method: i32, pub use_ssl: bool, pub path: String, pub port: i32, pub auth_info: Option<BasicAuthentication>, pub mask_headers: bool, pub headers: BTreeMap<String, String>, pub content_type: i32, pub custom_content_type: String, pub validate_ssl: bool, pub body: Bytes, pub accepted_response_status_codes: Vec<ResponseStatusCode>, pub ping_config: Option<PingConfig>, pub auth_method: Option<AuthMethod>,
}
Expand description

Information involved in an HTTP/HTTPS Uptime check request.

Fields§

§request_method: i32

The HTTP request method to use for the check. If set to METHOD_UNSPECIFIED then request_method defaults to GET.

§use_ssl: bool

If true, use HTTPS instead of HTTP to run the check.

§path: String

Optional (defaults to “/”). The path to the page against which to run the check. Will be combined with the host (specified within the monitored_resource) and port to construct the full URL. If the provided path does not begin with “/”, a “/” will be prepended automatically.

§port: i32

Optional (defaults to 80 when use_ssl is false, and 443 when use_ssl is true). The TCP port on the HTTP server against which to run the check. Will be combined with host (specified within the monitored_resource) and path to construct the full URL.

§auth_info: Option<BasicAuthentication>

The authentication information. Optional when creating an HTTP check; defaults to empty. Do not set both auth_method and auth_info.

§mask_headers: bool

Boolean specifying whether to encrypt the header information. Encryption should be specified for any headers related to authentication that you do not wish to be seen when retrieving the configuration. The server will be responsible for encrypting the headers. On Get/List calls, if mask_headers is set to true then the headers will be obscured with ******.

§headers: BTreeMap<String, String>

The list of headers to send as part of the Uptime check request. If two headers have the same key and different values, they should be entered as a single header, with the value being a comma-separated list of all the desired values as described at https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). Entering two separate headers with the same key in a Create call will cause the first to be overwritten by the second. The maximum number of headers allowed is 100.

§content_type: i32

The content type header to use for the check. The following configurations result in errors:

  1. Content type is specified in both the headers field and the content_type field.
  2. Request method is GET and content_type is not TYPE_UNSPECIFIED
  3. Request method is POST and content_type is TYPE_UNSPECIFIED.
  4. Request method is POST and a “Content-Type” header is provided via headers field. The content_type field should be used instead.
§custom_content_type: String

A user provided content type header to use for the check. The invalid configurations outlined in the content_type field apply to custom_content_type, as well as the following:

  1. content_type is URL_ENCODED and custom_content_type is set.
  2. content_type is USER_PROVIDED and custom_content_type is not set.
§validate_ssl: bool

Boolean specifying whether to include SSL certificate validation as a part of the Uptime check. Only applies to checks where monitored_resource is set to uptime_url. If use_ssl is false, setting validate_ssl to true has no effect.

§body: Bytes

The request body associated with the HTTP POST request. If content_type is URL_ENCODED, the body passed in must be URL-encoded. Users can provide a Content-Length header via the headers field or the API will do so. If the request_method is GET and body is not empty, the API will return an error. The maximum byte size is 1 megabyte.

Note: If client libraries aren’t used (which performs the conversion automatically) base64 encode your body data since the field is of bytes type.

§accepted_response_status_codes: Vec<ResponseStatusCode>

If present, the check will only pass if the HTTP response status code is in this set of status codes. If empty, the HTTP status code will only pass if the HTTP status code is 200-299.

§ping_config: Option<PingConfig>

Contains information needed to add pings to an HTTP check.

§auth_method: Option<AuthMethod>

This field is optional and should be set only by users interested in an authenticated uptime check. Do not set both auth_method and auth_info.

Implementations§

source§

impl HttpCheck

source

pub fn request_method(&self) -> RequestMethod

Returns the enum value of request_method, or the default if the field is set to an invalid enum value.

source

pub fn set_request_method(&mut self, value: RequestMethod)

Sets request_method to the provided enum value.

source

pub fn content_type(&self) -> ContentType

Returns the enum value of content_type, or the default if the field is set to an invalid enum value.

source

pub fn set_content_type(&mut self, value: ContentType)

Sets content_type to the provided enum value.

Trait Implementations§

source§

impl Clone for HttpCheck

source§

fn clone(&self) -> HttpCheck

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for HttpCheck

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for HttpCheck

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Message for HttpCheck

source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
source§

fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message to a buffer. Read more
source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
source§

fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
source§

fn decode<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes an instance of the message from a buffer. Read more
source§

fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes a length-delimited instance of the message from the buffer.
source§

fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
source§

fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
source§

impl PartialEq for HttpCheck

source§

fn eq(&self, other: &HttpCheck) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for HttpCheck

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more