Struct google_servicecontrol1::ServiceMethods[][src]

pub struct ServiceMethods<'a, C, A> where
    C: 'a,
    A: 'a, 
{ /* fields omitted */ }

A builder providing access to all methods supported on service resources. It is not used directly, but through the ServiceControl hub.

Example

Instantiate a resource builder

extern crate hyper;
extern crate hyper_rustls;
extern crate yup_oauth2 as oauth2;
extern crate google_servicecontrol1 as servicecontrol1;
 
use std::default::Default;
use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
use servicecontrol1::ServiceControl;
 
let secret: ApplicationSecret = Default::default();
let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
                              hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())),
                              <MemoryStorage as Default>::default(), None);
let mut hub = ServiceControl::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `allocate_quota(...)`, `check(...)`, `end_reconciliation(...)`, `release_quota(...)`, `report(...)` and `start_reconciliation(...)`
// to build up your call.
let rb = hub.services();

Methods

impl<'a, C, A> ServiceMethods<'a, C, A>
[src]

Create a builder to help you perform the following task:

Releases previously allocated quota done through AllocateQuota method.

This method requires the servicemanagement.services.quota permission on the specified service. For more information, see Cloud IAM.

NOTE: The client must fail-open on server errors INTERNAL, UNKNOWN, DEADLINE_EXCEEDED, and UNAVAILABLE. To ensure system reliability, the server may inject these errors to prohibit any hard dependency on the quota functionality.

Arguments

  • request - No description provided.
  • serviceName - Name of the service as specified in the service configuration. For example, "pubsub.googleapis.com". See google.api.Service for the definition of a service name.

Create a builder to help you perform the following task:

Checks an operation with Google Service Control to decide whether the given operation should proceed. It should be called before the operation is executed.

If feasible, the client should cache the check results and reuse them for 60 seconds. In case of server errors, the client can rely on the cached results for longer time.

NOTE: the CheckRequest has the size limit of 64KB.

This method requires the servicemanagement.services.check permission on the specified service. For more information, see Google Cloud IAM.

Arguments

  • request - No description provided.
  • serviceName - The service name as specified in its service configuration. For example, "pubsub.googleapis.com". See google.api.Service for the definition of a service name.

Create a builder to help you perform the following task:

Unlike rate quota, allocation quota does not get refilled periodically. So, it is possible that the quota usage as seen by the service differs from what the One Platform considers the usage is. This is expected to happen only rarely, but over time this can accumulate. Services can invoke StartReconciliation and EndReconciliation to correct this usage drift, as described below:

  1. Service sends StartReconciliation with a timestamp in future for each metric that needs to be reconciled. The timestamp being in future allows to account for in-flight AllocateQuota and ReleaseQuota requests for the same metric.
  2. One Platform records this timestamp and starts tracking subsequent AllocateQuota and ReleaseQuota requests until EndReconciliation is called.
  3. At or after the time specified in the StartReconciliation, service sends EndReconciliation with the usage that needs to be reconciled to.
  4. One Platform adjusts its own record of usage for that metric to the value specified in EndReconciliation by taking in to account any allocation or release between StartReconciliation and EndReconciliation.

Signals the quota controller that the service wants to perform a usage reconciliation as specified in the request.

This method requires the servicemanagement.services.quota permission on the specified service. For more information, see Google Cloud IAM.

Arguments

  • request - No description provided.
  • serviceName - Name of the service as specified in the service configuration. For example, "pubsub.googleapis.com". See google.api.Service for the definition of a service name.

Create a builder to help you perform the following task:

Signals the quota controller that service ends the ongoing usage reconciliation.

This method requires the servicemanagement.services.quota permission on the specified service. For more information, see Google Cloud IAM.

Arguments

  • request - No description provided.
  • serviceName - Name of the service as specified in the service configuration. For example, "pubsub.googleapis.com". See google.api.Service for the definition of a service name.

Create a builder to help you perform the following task:

Attempts to allocate quota for the specified consumer. It should be called before the operation is executed.

This method requires the servicemanagement.services.quota permission on the specified service. For more information, see Cloud IAM.

NOTE: The client must fail-open on server errors INTERNAL, UNKNOWN, DEADLINE_EXCEEDED, and UNAVAILABLE. To ensure system reliability, the server may inject these errors to prohibit any hard dependency on the quota functionality.

Arguments

  • request - No description provided.
  • serviceName - Name of the service as specified in the service configuration. For example, "pubsub.googleapis.com". See google.api.Service for the definition of a service name.

Create a builder to help you perform the following task:

Reports operation results to Google Service Control, such as logs and metrics. It should be called after an operation is completed.

If feasible, the client should aggregate reporting data for up to 5 seconds to reduce API traffic. Limiting aggregation to 5 seconds is to reduce data loss during client crashes. Clients should carefully choose the aggregation time window to avoid data loss risk more than 0.01% for business and compliance reasons.

NOTE: the ReportRequest has the size limit of 1MB.

This method requires the servicemanagement.services.report permission on the specified service. For more information, see Google Cloud IAM.

Arguments

  • request - No description provided.
  • serviceName - The service name as specified in its service configuration. For example, "pubsub.googleapis.com". See google.api.Service for the definition of a service name.

Trait Implementations

impl<'a, C, A> MethodsBuilder for ServiceMethods<'a, C, A>
[src]

Auto Trait Implementations

impl<'a, C, A> !Send for ServiceMethods<'a, C, A>

impl<'a, C, A> !Sync for ServiceMethods<'a, C, A>