ConfigServiceV2

Struct ConfigServiceV2 

Source
pub struct ConfigServiceV2 { /* private fields */ }
Expand description

Implements a client for the Cloud Logging API.

§Example

let client = ConfigServiceV2::builder().build().await?;
// use `client` to make requests to the Cloud Logging API.

§Service Description

Service for configuring sinks used to route log entries.

§Configuration

To configure ConfigServiceV2 use the with_* methods in the type returned by builder(). The default configuration should work for most applications. Common configuration changes include

  • with_endpoint(): by default this client uses the global default endpoint (https://logging.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default.
  • with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.

§Pooling and Cloning

ConfigServiceV2 holds a connection pool internally, it is advised to create one and the reuse it. You do not need to wrap ConfigServiceV2 in an Rc or Arc to reuse it, because it already uses an Arc internally.

Implementations§

Source§

impl ConfigServiceV2

Source

pub fn builder() -> ClientBuilder

Returns a builder for ConfigServiceV2.

let client = ConfigServiceV2::builder().build().await?;
Source

pub fn from_stub<T>(stub: T) -> Self
where T: ConfigServiceV2 + 'static,

Creates a new client from the provided stub.

The most common case for calling this function is in tests mocking the client’s behavior.

Source

pub fn list_buckets(&self) -> ListBuckets

Lists log buckets.

Source

pub fn get_bucket(&self) -> GetBucket

Gets a log bucket.

Source

pub fn create_bucket_async(&self) -> CreateBucketAsync

Creates a log bucket asynchronously that can be used to store log entries.

After a bucket has been created, the bucket’s location cannot be changed.

§Long running operations

This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.

Source

pub fn update_bucket_async(&self) -> UpdateBucketAsync

Updates a log bucket asynchronously.

If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.

After a bucket has been created, the bucket’s location cannot be changed.

§Long running operations

This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.

Source

pub fn create_bucket(&self) -> CreateBucket

Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket’s location cannot be changed.

Source

pub fn update_bucket(&self) -> UpdateBucket

Updates a log bucket.

If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.

After a bucket has been created, the bucket’s location cannot be changed.

Source

pub fn delete_bucket(&self) -> DeleteBucket

Deletes a log bucket.

Changes the bucket’s lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.

Source

pub fn undelete_bucket(&self) -> UndeleteBucket

Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.

Source

pub fn list_views(&self) -> ListViews

Lists views on a log bucket.

Source

pub fn get_view(&self) -> GetView

Gets a view on a log bucket..

Source

pub fn create_view(&self) -> CreateView

Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.

Source

pub fn update_view(&self) -> UpdateView

Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.

Source

pub fn delete_view(&self) -> DeleteView

Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.

Source

pub fn list_sinks(&self) -> ListSinks

Lists sinks.

Source

pub fn get_sink(&self) -> GetSink

Gets a sink.

Source

pub fn create_sink(&self) -> CreateSink

Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink’s writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.

Source

pub fn update_sink(&self) -> UpdateSink

Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.

The updated sink might also have a new writer_identity; see the unique_writer_identity field.

Source

pub fn delete_sink(&self) -> DeleteSink

Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.

Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.

§Long running operations

This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.

Deletes a link. This will also delete the corresponding BigQuery linked dataset.

§Long running operations

This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.

Lists links.

Gets a link.

Source

pub fn list_exclusions(&self) -> ListExclusions

Lists all the exclusions on the _Default sink in a parent resource.

Source

pub fn get_exclusion(&self) -> GetExclusion

Gets the description of an exclusion in the _Default sink.

Source

pub fn create_exclusion(&self) -> CreateExclusion

Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.

Source

pub fn update_exclusion(&self) -> UpdateExclusion

Changes one or more properties of an existing exclusion in the _Default sink.

Source

pub fn delete_exclusion(&self) -> DeleteExclusion

Deletes an exclusion in the _Default sink.

Source

pub fn get_cmek_settings(&self) -> GetCmekSettings

Gets the Logging CMEK settings for the given resource.

Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.

See Enabling CMEK for Log Router for more information.

Source

pub fn update_cmek_settings(&self) -> UpdateCmekSettings

Updates the Log Router CMEK settings for the given resource.

Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.

UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.

See Enabling CMEK for Log Router for more information.

Source

pub fn get_settings(&self) -> GetSettings

Gets the Log Router settings for the given resource.

Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.

See Enabling CMEK for Log Router for more information.

Source

pub fn update_settings(&self) -> UpdateSettings

Updates the Log Router settings for the given resource.

Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.

UpdateSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled. 4) location_id is not supported by Logging. 5) location_id violate OrgPolicy.

See Enabling CMEK for Log Router for more information.

Source

pub fn copy_log_entries(&self) -> CopyLogEntries

Copies a set of log entries from a log bucket to a Cloud Storage bucket.

§Long running operations

This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.

Source

pub fn list_operations(&self) -> ListOperations

Provides the Operations service functionality in this service.

Source

pub fn get_operation(&self) -> GetOperation

Provides the Operations service functionality in this service.

Source

pub fn cancel_operation(&self) -> CancelOperation

Provides the Operations service functionality in this service.

Trait Implementations§

Source§

impl Clone for ConfigServiceV2

Source§

fn clone(&self) -> ConfigServiceV2

Returns a duplicate 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 ConfigServiceV2

Source§

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

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

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

Source§

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>,

Source§

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>,

Source§

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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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