[][src]Struct aiven_rs::service::ServiceApi

pub struct ServiceApi { /* fields omitted */ }

Methods

impl ServiceApi[src]

pub async fn cancel_query<'_, '_, '_, '_, T: Serialize + ?Sized>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str,
    json_body: &'_ T
) -> Result<ServiceCancelQuery, AivenError>
[src]

Cancel specified query from service

https://api.aiven.io/doc/#api-Service-ServiceCancelQuery

Examples

Basic usage:

use std::collections::HashMap;
#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let mut json_body = HashMap::new();
json_body.insert("authentication", "caching_sha2_password");
json_body.insert("username", "some-user");
let response = client
    .service()
    .cancel_query("some-project", "some-service_name", &json_body)
    .await?;
Ok(())
}

pub async fn create_user<'_, '_, '_, '_, T: Serialize + ?Sized>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str,
    json_body: &'_ T
) -> Result<ResServiceUser, AivenError>
[src]

Create a new (sub) user for service

https://api.aiven.io/doc/#api-Service-ServiceUserCreate

Arguments

  • authentication - Authentication details, Allowed values: "caching_sha2_password", "mysql_native_password"
  • username - Service username, Size range: ..40

Examples

Basic usage:

use std::collections::HashMap;
#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let mut json_body = HashMap::new();
json_body.insert("authentication", "caching_sha2_password");
json_body.insert("username", "some-user");
let response = client
    .service()
    .create_user("some-project", "some-service_name", &json_body)
    .await?;
Ok(())
}

pub async fn create_logical_database<'_, '_, '_, '_, T: Serialize + ?Sized>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str,
    json_body: &'_ T
) -> Result<(), AivenError>
[src]

Create a new logical database for service

https://api.aiven.io/doc/#api-Service-ServiceDatabaseCreate

Arguments

  • project - Project name
  • service_name - service_name

Examples

Basic usage:

use std::collections::HashMap;
#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let mut json_body = HashMap::new();
json_body.insert("database", "testdb");
let response = client
    .service()
    .create_logical_database("some-project", "some-service_name", &json_body)
    .await?;
Ok(())
}

pub async fn create_new_task<'_, '_, '_, '_, T: Serialize + ?Sized>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str,
    json_body: &'_ T
) -> Result<ResTask, AivenError>
[src]

Create a new task for service

https://api.aiven.io/doc/#api-Service-ServiceTaskCreate

Arguments

  • project - Project name
  • service_name - service_name

Examples

Basic usage:

use std::collections::HashMap;
#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let mut json_body = HashMap::new();
json_body.insert("target_version", "10");
json_body.insert("task_type", "upgrade_check");
let response = client
   .service()
   .create_new_task("some-project", "some-service_name", &json_body)
   .await?;
Ok(())
}

pub async fn create_service<'_, '_, '_, T: Serialize + ?Sized>(
    &'_ self,
    project: &'_ str,
    json_body: &'_ T
) -> Result<ResService, AivenError>
[src]

Create a service

https://api.aiven.io/doc/#api-Service-ServiceCreate

Arguments

  • project - Project name

Examples

Basic usage:

use serde_json::json;

#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
use std::collections::HashMap;
let mut json_body = HashMap::new();
json_body.insert("authentication", "caching_sha2_password");
json_body.insert("username", "some-user");
let response = client
        .service()
        .create_service("project-name",&json_body)
        .await?;
Ok(())
}

pub async fn delete_logical_db<'_, '_, '_, '_>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str,
    db_name: &'_ str
) -> Result<(), AivenError>
[src]

Delete a logical database

https://api.aiven.io/doc/#api-Service-ServiceDatabaseDelete

Arguments

  • project - Project name

Examples

Basic usage:

use serde_json::json;

#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let response = client
        .service()
        .delete_logical_db("project-name","servicename", "dbname")
        .await?;
Ok(())
}

pub async fn delete_user<'_, '_, '_, '_>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str,
    service_username: &'_ str
) -> Result<(), AivenError>
[src]

Delete a service user

https://api.aiven.io/doc/#api-Service-ServiceUserDelete

Arguments

  • project - Project name

Examples

Basic usage:

use serde_json::json;

#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let response = client
        .service()
        .delete_user("project-name","servicename", "service_username")
        .await?;
Ok(())
}

pub async fn fetch_current_queries<'_, '_, '_, '_, T: Serialize + ?Sized>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str,
    json_body: &'_ T
) -> Result<ResQueries, AivenError>
[src]

Fetch current queries for the service

https://api.aiven.io/doc/#api-Service-ServiceQueryActivity

Examples

Basic usage:

use serde_json::json;
#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let body = json!({
"limit": 100,
"offset": 100,
"order_by": "client_id:desc"
});
let response = client
        .service()
        .fetch_current_queries("my-project", "my-service-name", &body)
        .await?;
Ok(())
}

pub async fn fetch_service_metrics<'_, '_, '_, '_, T: Serialize + ?Sized>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str,
    json_body: &'_ T
) -> Result<Value, AivenError>
[src]

Fetch service metrics

https://api.aiven.io/doc/#api-Service-ServiceMetricsFetch

Examples

Basic usage:

use serde_json::json;
#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let body = json!({   "period": "hour"});
let response = client
        .service()
        .fetch_service_metrics("my-project", "my-service-name", &body)
        .await?;
Ok(())
}

pub async fn get_user_details<'_, '_, '_, '_>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str,
    service_username: &'_ str
) -> Result<ResServiceUser, AivenError>
[src]

Get details for a single user

https://api.aiven.io/doc/#api-Service-ServiceUserGet

Examples

Basic usage:

use serde_json::json;
#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "some-token");
let response = client
        .service()
        .get_user_details("project", "service_name", "myserviceuser")
        .await?;
Ok(())
}

pub async fn get_service_info<'_, '_, '_>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str
) -> Result<ResService, AivenError>
[src]

Get service information

https://api.aiven.io/doc/#api-Service-ServiceGet

Examples

Basic usage:

use serde_json::json;
#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "some-token");
let response = client
        .service()
        .get_service_info("project", "service_name")
        .await?;
Ok(())
}

pub async fn get_log_entries<'_, '_, '_, '_, T: Serialize + ?Sized>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str,
    json_body: &'_ T
) -> Result<ResLogs, AivenError>
[src]

Get service log entries

https://api.aiven.io/doc/#api-Service-ProjectGetServiceLogs

Examples

Basic usage:

use serde_json::json;
#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "some-token");
let json_body = json!({
"limit": 100,
"offset": "23425325",
"sort_order": "asc"
});
let response = client
        .service()
        .get_log_entries("project", "service_name", &json_body)
        .await?;
Ok(())
}

pub async fn get_task_result<'_, '_, '_, '_>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str,
    task_id: &'_ str
) -> Result<ResTask, AivenError>
[src]

Get task result

https://api.aiven.io/doc/#api-Service-ServiceTaskGet

Examples

Basic usage:

use serde_json::json;
#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "some-token");
let response = client
        .service()
        .get_task_result("project", "service_name", "task_id")
        .await?;
Ok(())
}

pub async fn list_public_service_types<'_>(
    &'_ self
) -> Result<ResServiceTypes, AivenError>
[src]

List publicly available service types

https://api.aiven.io/doc/#api-Service-ListPublicServiceTypes

Examples

Basic usage:

use serde_json::json;
#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "some-token");
let response = client
        .service()
        .list_public_service_types()
        .await?;
Ok(())
}

pub async fn list_service_types<'_, '_>(
    &'_ self,
    project: &'_ str
) -> Result<ResServiceTypes, AivenError>
[src]

List service types for a project

https://api.aiven.io/doc/#api-Service-ListProjectServiceTypes

Examples

Basic usage:

use serde_json::json;
#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "some-token");
let response = client
        .service()
        .list_service_types("project")
        .await?;
Ok(())
}

pub async fn list_service_databases<'_, '_, '_>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str
) -> Result<ResDatabaseNames, AivenError>
[src]

List service databases

https://api.aiven.io/doc/#api-Service-ServiceDatabaseList

Examples

Basic usage:

#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "some-token");
let response = client
  .service()
  .list_service_databases("my-project", "my-service-name")
  .await?;
Ok(())
}

pub async fn list_active_alerts<'_, '_, '_>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str
) -> Result<ResAlerts, AivenError>
[src]

List active alerts for service

https://api.aiven.io/doc/#api-Service-ServiceAlertsList

Examples

Basic usage:

use serde_json::json;
#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "some-token");
let response = client
        .service()
        .list_active_alerts("project-name", "service-name")
        .await?;
Ok(())
}

pub async fn list_services<'_, '_>(
    &'_ self,
    project: &'_ str
) -> Result<ResServices, AivenError>
[src]

List services

https://api.aiven.io/doc/#api-Service-ServiceList

Examples

Basic usage:

use serde_json::json;
#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "some-token");
let response = client
        .service()
        .list_services("project-name")
        .await?;
Ok(())
}

pub async fn modify_service_user_credential<'_, '_, '_, '_>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str,
    service_username: &'_ str
) -> Result<ResService, AivenError>
[src]

Modify service user credentials

https://api.aiven.io/doc/#api-Service-ServiceUserCredentialsModify

Examples

Basic usage:

#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let response = client
        .service()
        .modify_service_user_credential("my-project",
        "my-service-name",
        "service-user-name")
        .await?;
Ok(())
}

pub async fn reset_service_user_credential<'_, '_, '_, '_>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str,
    service_username: &'_ str
) -> Result<ResService, AivenError>
[src]

Reset service user credentials

https://api.aiven.io/doc/#api-Service-ServiceUserCredentialsReset

Examples

Basic usage:

#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let response = client
        .service()
        .reset_service_user_credential("my-project", "my-service-name", "service-user-name")
        .await?;
Ok(())
}

pub async fn reset_query_stats<'_, '_, '_>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str
) -> Result<ResResetQueryStats, AivenError>
[src]

Reset service's query statistics

https://api.aiven.io/doc/#api-Service-ServiceQueryStatisticsReset

Examples

Basic usage:

#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let response = client
        .service()
        .reset_query_stats("my-project", "my-service-name")
        .await?;
Ok(())
}

pub async fn get_service_ca<'_, '_, '_, '_>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str,
    ca_name: &'_ str
) -> Result<ResServiceCA, AivenError>
[src]

Retrieve a service CA

https://api.aiven.io/doc/#api-Service-ServiceKmsGetCA

Examples

Basic usage:

#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let response = client
        .service()
        .get_service_ca("my-project", "my-service-name", "ca-name")
        .await?;
Ok(())
}

pub async fn get_service_keypair<'_, '_, '_, '_>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str,
    keypair_name: &'_ str
) -> Result<ResServiceKeyPair, AivenError>
[src]

Retrieve service keypair

https://api.aiven.io/doc/#api-Service-ServiceKmsGetKeypair

Examples

Basic usage:

#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let response = client
        .service()
        .get_service_keypair("my-project", "my-service-name", "keypairname")
        .await?;
Ok(())
}

pub async fn start_maintenance_updates<'_, '_, '_>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str
) -> Result<(), AivenError>
[src]

Start maintenance updates

https://api.aiven.io/doc/#api-Service-ServiceMaintenanceStart

Examples

Basic usage:

#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let response = client
        .service()
        .start_maintenance_updates("my-project", "my-service-name")
        .await?;
Ok(())
}

pub async fn enable_writes<'_, '_, '_>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str
) -> Result<ResEnableWrites, AivenError>
[src]

Temporarily enable writes for a service in read-only mode. Will only work if disk usage is lower than 99.0%

https://api.aiven.io/doc/#api-Service-ServiceEnableWrites

Examples

Basic usage:

#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let response = client
        .service()
        .enable_writes("my-project", "my-service-name")
        .await?;
Ok(())
}

pub async fn update_configuration<'_, '_, '_, '_, T: Serialize + ?Sized>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str,
    json_body: &'_ T
) -> Result<ResService, AivenError>
[src]

Update service configuration

https://api.aiven.io/doc/#api-Service-ServiceUpdate

Examples

Basic usage:

use serde_json::json;
#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "token");
let body = json!({
"cloud": "aws-eu-central-1",
"group_name": "mygroup",
"maintenance": {
"dow": "sunday",
"time": "12:30:00"
},
"plan": "hobbyist",
"powered": true,
"project_vpc_id": "1007a317-aa2a-4fb4-9056-93924c5ee46f",
"termination_protection": true,
"user_config": {}
});
let response = client
        .service()
        .update_configuration("my-project", "my-service-name", &body)
        .await?;
Ok(())
}

pub async fn terminate<'_, '_, '_>(
    &'_ self,
    project: &'_ str,
    service_name: &'_ str
) -> Result<(), AivenError>
[src]

Terminate a service

https://api.aiven.io/doc/#api-Service-ServiceDelete

Examples

Basic usage:

#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let response = client
        .service()
        .terminate("my-project", "my-service-name")
        .await?;
Ok(())
}

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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