dsh_api::dsh_api_client

Struct DshApiClient

Source
pub struct DshApiClient<'a> { /* private fields */ }

Implementations§

Source§

impl DshApiClient<'_>

§Manage apps in the App Catalog

Module that contains functions to manage pre-packaged, easily configured apps that you can select from the App Catalog.

  • API methods - DshApiClient methods that directly call the API.
  • Derived methods - DshApiClient methods that add extra capabilities but depend on the API methods.
  • Functions - Functions that add extra capabilities but do not depend directly on the API.

§API methods

DshApiClient methods that directly call the DSH resource management API.

§Derived methods

DshApiClient methods that add extra capabilities but do not directly call the DSH resource management API. These derived methods depend on the API methods for this.

Source

pub async fn get_app_configuration( &self, app_id: &str, ) -> DshApiResult<AppCatalogApp>

§Return App configuration

API function: GET /allocation/{tenant}/appcatalogapp/{appcatalogappid}/configuration

§Parameters
  • app_id - app id of the requested configuration
§Returns
Source

pub async fn get_app_configurations( &self, ) -> DshApiResult<HashMap<String, AppCatalogApp>>

§Get all App configurations

API function: GET /allocation/{tenant}/appcatalogapp/configuration

§Returns
  • Ok<HashMap<String, AppCatalogApp>> - hashmap containing the app configurations
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_app_configurations( &self, ) -> DshApiResult<Vec<(String, AppCatalogApp)>>

§List all App configurations
§Returns
  • Ok<Vec<(String, AppCatalogApp)>> - list containing the app ids and configurations, sorted by app id
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_app_ids(&self) -> DshApiResult<Vec<String>>

§List all App ids

If you also need the app configuration, use list_app_configurations() instead.

§Returns
  • Ok<Vec<String>> - vector containing the sorted app ids
  • Err<DshApiError> - when the request could not be processed by the DSH
Source§

impl DshApiClient<'_>

§Manage the App Catalog

Module that contains functions to configure apps you start from the App Catalog.

Source

pub async fn create_app_catalog_configuration( &self, app_catalog_id: &str, body: &AppCatalogAppConfiguration, ) -> DshApiResult<()>

§Create or update a new App Catalog App

API function: PUT /appcatalog/{tenant}/appcatalogapp/{appcatalogappid}/configuration

§Parameters
  • app_catalog_id - id of the app that must be deleted
  • configuration - configuration of the app that must created or updated
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the app has been successfully deleted)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn delete_app_catalog_configuration( &self, app_catalog_id: &str, ) -> DshApiResult<()>

§Delete an App Catalog App

API function: DELETE /appcatalog/{tenant}/appcatalogapp/{appcatalogappid}/configuration

§Parameters
  • app_catalog_id - id of the app that must be deleted
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the app has been successfully deleted)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_app_catalog_configuration_allocation_status( &self, app_catalog_id: &str, ) -> DshApiResult<AllocationStatus>

§Get an App Catalog App status

API function: GET /appcatalog/{tenant}/appcatalogapp/{appcatalogappid}/status

§Parameters
  • app_catalog_id - id of the requested app
§Returns
Source

pub async fn get_app_catalog_configuration( &self, app_catalog_id: &str, ) -> DshApiResult<AppCatalogAppConfiguration>

§Get an App Catalog App configuration

API function: GET /appcatalog/{tenant}/appcatalogapp/{appcatalogappid}/configuration

§Parameters
  • app_catalog_id - id of the requested app
§Returns
Source§

impl DshApiClient<'_>

§View the App Catalog manifests

Module that contains a function to query the App Catalog for all manifest files.

Source

pub async fn list_app_catalog_manifests( &self, ) -> DshApiResult<Vec<AppCatalogManifest>>

§Return a list of all App Catalog manifests

API function: GET /appcatalog/{tenant}/manifest

§Returns
Source

pub async fn list_app_catalog_manifest_ids(&self) -> DshApiResult<Vec<String>>

§Return sorted list of all App Catalog manifest ids
§Returns
  • Ok<Vec<String>> - vector containing all manifest ids
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_app_catalog_manifest_ids_with_versions( &self, ) -> DshApiResult<Vec<(String, Vec<String>)>>

§Return list of all App Catalog manifest ids with available version numbers
§Returns
  • Ok<Vec<(String, Vec<String>)>> - vector containing pairs of ids and versions
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_app_catalog_manifests_with_versions( &self, ) -> DshApiResult<Vec<(String, Vec<(String, Manifest)>)>>

§Return list of all App Catalog manifests with available manifest versions
§Returns
  • Ok<Vec<(String, Vec<(String, Manifest)>)>> - vector containing pairs of ids and versions
  • Err<DshApiError> - when the request could not be processed by the DSH
Source§

impl DshApiClient<'_>

§Manage applications

Module that contains methods and functions to manage applications.

Source

pub async fn create_application( &self, application_id: &str, configuration: Application, ) -> DshApiResult<()>

§Create application

API function: PUT /allocation/{tenant}/application/{appid}/configuration

§Parameters
  • application_id - application name used when deploying the application
  • configuration - configuration used when deploying the application
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the application has been successfully deployed)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn delete_application(&self, application_id: &str) -> DshApiResult<()>

§Delete application

API function: DELETE /allocation/{tenant}/application/{appid}/configuration

§Parameters
  • application_id - application name of the application to undeploy
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the application has been successfully undeployed)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_application_allocation_status( &self, application_id: &str, ) -> DshApiResult<AllocationStatus>

§Return allocation status of application

API function: GET /allocation/{tenant}/application/{appid}/status

§Parameters
  • application_id - application id of the requested application
§Returns
Source

pub async fn get_application( &self, application_id: &str, ) -> DshApiResult<Application>

§Return application configuration

API function: GET /allocation/{tenant}/application/{appid}/configuration

§Parameters
  • application_id - application id of the requested application
§Returns
  • Ok<Application> - application configuration
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_applications( &self, ) -> DshApiResult<HashMap<String, Application>>

§Return all applications with their configuration

API function: GET /allocation/{tenant}/application/configuration

§Returns
  • Ok<HashMap<String, Application>> - hashmap containing the application configurations
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_application_derived_task_ids( &self, application_id: &str, ) -> DshApiResult<Vec<String>>

§Return all derived task ids for an application

API function: GET /allocation/{tenant}/task{appid}

§Parameters
  • application_id - application name for which the tasks will be returned
§Returns
  • Ok<Vec<String>> - vector containing names of all derived tasks for the application
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_application_ids_with_derived_tasks( &self, ) -> DshApiResult<Vec<String>>

§Return ids of all applications that have derived tasks

API function: GET /allocation/{tenant}/task

§Returns
  • Ok<Vec<String>> - vector containing names of all application that have derived tasks
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_application_task( &self, application_id: &str, task_id: &str, ) -> DshApiResult<TaskStatus>

§Return status of derived task

API function: GET /allocation/{tenant}/task{appid}/{id}

§Parameters
  • application_id - application name of the requested application
  • task_id - id of the requested task
§Returns
  • Ok<TaskStatus> - application task status
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_application_task_allocation_status( &self, application_id: &str, task_id: &str, ) -> DshApiResult<AllocationStatus>

§Return task allocation status

API function: GET /allocation/{tenant}/task{appid}/{id}/status

§Parameters
  • application_id - application name of the requested application
  • task_id - id of the requested task
§Returns
Source

pub async fn list_application_allocation_statuses( &self, ) -> DshApiResult<Vec<(String, AllocationStatus)>>

§List application ids with the corresponding allocation status
§Returns
  • Ok<Vec<(String, AllocationStatus)>> - list of application ids and allocation statuses
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_applications( &self, ) -> DshApiResult<Vec<(String, Application)>>

§List all application configurations with their ids
§Returns
  • Ok<Vec<(String, Application)>> - list of application ids and configurations
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn find_applications( &self, predicate: &dyn Fn(&Application) -> bool, ) -> DshApiResult<Vec<(String, Application)>>

§Find all applications that match a predicate
§Parameters
  • predicate - predicate that will be used to filter the applications
§Returns
  • Ok<Vec<(String, Application)>> - list of id/application pairs, ordered by id, for which the predicate returned true
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_application_ids(&self) -> DshApiResult<Vec<String>>

§Return all application ids

If you also need the application configuration, use list_applications() instead.

§Returns
  • Ok<Vec<String>> - vector containing the sorted application ids
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_applications_with_secret_injections( &self, ) -> DshApiResult<Vec<(String, Application, Vec<(String, Vec<Injection>)>)>>

§List applications with secret injections
§Returns
  • Vec<(String, Application, Vec(<String, Vec<String>)>)> - list of tuples that describe the applications with secret injections. Each tuple consist of the application id, the Application and a list of secret ids with the environment variables that the secrets are injected into.
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn find_applications_that_use_env_value( &self, query_processor: &dyn QueryProcessor, ) -> DshApiResult<Vec<(String, Application, Vec<(String, Vec<Part>)>)>>

§Find application that use an environment variable value
§Parameters
  • query_process - [QueryProcessor] that is matched against all environment variables of all applications
§Returns
  • Vec<(String, Application, Vec<(String, Vec<Part>)>)> - list of tuples that describe the matched environment variables. Each tuple consist of
    • String - id of the application that contains the value,
    • Application - the application data and
    • Vec<(String, Vec<Part>)> - list of environment variable key/value pairs that matched the query
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn find_applications_with_secret_injections( &self, secret_id: &str, ) -> DshApiResult<Vec<(String, Application, Vec<Injection>)>>

§Find applications that use a secret injection
§Parameters
  • secret_id - the secret that is matched against all applications
§Returns
  • Vec<(String, Application, Vec<String>)> - list of tuples that describe the applications with secret injections. Each tuple consist of the application id, the Application and a map of environment variables that the secret is injected into.
  • Err<DshApiError> - when the request could not be processed by the DSH
Source§

impl DshApiClient<'_>

§Manage buckets

Module that contains methods and functions to manage buckets.

  • API methods - DshApiClient methods that directly call the API.
  • Derived methods - DshApiClient methods that add extra capabilities but depend on the API methods.

§API methods

DshApiClient methods that directly call the DSH resource management API.

§Derived methods

DshApiClient methods that add extra capabilities but do not directly call the DSH resource management API. These derived methods depend on the API methods for this.

Source

pub async fn delete_bucket(&self, bucket_id: &str) -> DshApiResult<()>

§Delete bucket

API function: DELETE /allocation/{tenant}/bucket/{id}/configuration

§Parameters
  • bucket_id - id of the bucket to delete
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the bucket has been successfully deleted)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_bucket(&self, bucket_id: &str) -> DshApiResult<BucketStatus>

§Get bucket

API function: GET /allocation/{tenant}/bucket/{id}

§Parameters
  • bucket_id - id of the requested bucket
§Returns
Source

pub async fn get_bucket_allocation_status( &self, bucket_id: &str, ) -> DshApiResult<AllocationStatus>

§Return bucket allocation status

API function: GET /allocation/{tenant}/bucket/{id}/status

§Parameters
  • bucket_id - id of the requested bucket
§Returns
Source

pub async fn get_bucket_configuration( &self, bucket_id: &str, ) -> DshApiResult<Bucket>

§Return bucket configuration

API function: GET /allocation/{tenant}/bucket/{id}/configuration

§Parameters
  • bucket_id - id of the requested bucket
§Returns
  • Ok<Bucket> - indicates that bucket is ok
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_bucket_ids(&self) -> DshApiResult<Vec<String>>

§Return list of bucket ids

API function: GET /allocation/{tenant}/bucket

§Returns
  • Ok<Vec<String> - bucket ids
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_buckets(&self) -> DshApiResult<Vec<(String, BucketStatus)>>

Return a list of all buckets

§Returns
  • Vec<(String, BucketStatus)> - list of tuples that describe the buckets, ordered by bucket id. Each tuple consist of
    • String - id of the bucket,
    • BucketStatus - the bucket data.
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_buckets(&self) -> DshApiResult<HashMap<String, BucketStatus>>

Return a map of all bucket ids and buckets

§Returns
  • HashMap<String, BucketStatus> - HashMap that maps all bucket ids to buckets.
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn update_bucket( &self, bucket_id: &str, bucket: Bucket, ) -> DshApiResult<()>

§Update bucket

API function: PUT /allocation/{tenant}/bucket/{id}/configuration

§Parameters
  • bucket_id - id of the bucket to update
  • bucket - new value of the bucket
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the bucket has been successfully updated)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source§

impl DshApiClient<'_>

§Manage certificates

Module that contains methods and functions to manage certificates.

  • API methods - DshApiClient methods that directly call the API.
  • Derived methods - DshApiClient methods that add extra capabilities but depend on the API methods.

§API methods

DshApiClient methods that directly call the DSH resource management API.

§Derived methods

DshApiClient methods that add extra capabilities but do not directly call the DSH resource management API. These derived methods depend on the API methods for this.

Source

pub async fn create_certificate( &self, certificate_id: &str, certificate: Certificate, ) -> DshApiResult<()>

§Create certificate

API function: PUT /allocation/{tenant}/certificate/{id}/configuration

§Parameters
  • certificate_id - id of the certificate to update
  • certificate - new value of the certificate
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the certificate has been successfully updated)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn delete_certificate(&self, certificate_id: &str) -> DshApiResult<()>

§Delete certificate

API function: DELETE /allocation/{tenant}/certificate/{id}/configuration

§Parameters
  • certificate_id - id of the certificate to delete
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the certificate has been successfully deleted)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_certificate( &self, certificate_id: &str, ) -> DshApiResult<CertificateStatus>

§Return certificate

API function: GET /allocation/{tenant}/certificate/{id}

§Parameters
  • certificate_id - id of the requested certificate
§Returns
Source

pub async fn get_certificate_allocation_status( &self, certificate_id: &str, ) -> DshApiResult<AllocationStatus>

§Return certificate allocation status

API function: GET /allocation/{tenant}/certificate/{id}/status

§Parameters
  • certificate_id - id of the requested certificate
§Returns
Source

pub async fn get_certificate_configuration( &self, certificate_id: &str, ) -> DshApiResult<Certificate>

§Return certificate configuration

API function: GET /allocation/{tenant}/certificate/{id}/configuration

§Parameters
  • certificate_id - id of the requested certificate
§Returns
  • Ok<Certificate> - indicates that certificate is ok
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_certificates_with_usage( &self, ) -> DshApiResult<Vec<(String, CertificateStatus, Vec<UsedBy>)>>

§List all certificates with usage

Returns a list of all certificate configurations, together with the apps and applications that use this certificate.

§Returns
  • Ok<Vec<(String, CertificateStatus, Vec<UsedBy>>> - list of tuples containing the certificate id, certificate configuration and a vector of usages, which can be empty.
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_certificate_with_usage( &self, certificate_id: &str, ) -> DshApiResult<(CertificateStatus, Vec<UsedBy>)>

§Return certificate with usage

Returns the certificate configuration for the provided certificate id, together with the apps and applications that use this certificate.

§Parameters
  • certificate_id - id of the requested certificate
§Returns
  • Ok<(CertificateStatus, Vec<UsedBy>> - tuple containing the certificate configuration and a vector of usages, which can be empty.
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_certificate_ids(&self) -> DshApiResult<Vec<String>>

§Return certificate ids

API function: GET /allocation/{tenant}/certificate

§Returns
  • Ok<Vec<String> - certificate ids
  • Err<DshApiError> - when the request could not be processed by the DSH
Source§

impl<'a> DshApiClient<'a>

Source

pub fn new( token: String, generated_client: &'a GeneratedClient, tenant: &'a DshApiTenant, ) -> Self

Source

pub fn api_version(&self) -> &'static str

§Returns the version of the openapi spec
Source

pub fn openapi_spec() -> &'static str

§Returns the openapi spec used to generate the client code

Note that this is not the original openapi specification exposed by the DSH resource management API. The version exposed by this function has two additions:

  • Added authorization header specification to each operation.
  • Added operationId parameter to each operation.
Source

pub fn tenant(&self) -> &DshApiTenant

Source

pub fn tenant_name(&self) -> &str

Source

pub fn platform(&self) -> &DshPlatform

Source

pub fn guid(&self) -> u16

Source

pub fn token(&self) -> &str

Source§

impl DshApiClient<'_>

§Manage proxies

Module that contains methods and functions to manage proxies.

  • API methods - DshApiClient methods that directly call the API.

§API methods

DshApiClient methods that directly call the DSH resource management API.

Source

pub async fn delete_proxy(&self, proxy_id: &str) -> DshApiResult<()>

§Delete proxy

API function: DELETE /allocation/{tenant}/kafkaproxy/{id}/configuration

§Parameters
  • proxy_id - id of the proxy to delete
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the proxy has been successfully deleted)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_proxy(&self, proxy_id: &str) -> DshApiResult<KafkaProxy>

§Return proxy

API function: GET /allocation/{tenant}/kafkaproxy/{id}/configuration

§Parameters
  • proxy_id - id of the requested proxy
§Returns
  • Ok<KafkaProxy> - proxy
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_proxy_ids(&self) -> DshApiResult<Vec<String>>

§Return sorted list of Kafka proxy ids

API function: GET /allocation/{tenant}/kafkaproxy

§Returns
  • Ok<Vec<String>> - list of proxy ids
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn update_proxy( &self, proxy_id: &str, proxy: KafkaProxy, ) -> DshApiResult<()>

§Update proxy configuration

API function: PUT /allocation/{tenant}/kafkaproxy/{id}/configuration

§Parameters
  • proxy_id - id of the proxy to update
  • proxy - new configuration of the proxy
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the proxy has been successfully updated)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source§

impl DshApiClient<'_>

§Manage secrets

Module that contains methods and functions to manage secrets.

  • API methods - DshApiClient methods that directly call the API.
  • Derived methods - DshApiClient methods that add extra capabilities but depend on the API methods.
  • Functions - Functions that add extra capabilities but do not depend directly on the API.

§API methods

DshApiClient methods that directly call the DSH resource management API.

§Derived methods

DshApiClient methods that add extra capabilities but do not directly call the DSH resource management API. These derived methods depend on the API methods for this.

Source

pub async fn create_secret(&self, secret: &Secret) -> DshApiResult<()>

§Create secret

API function: POST /allocation/{tenant}/secret

§Parameters
  • secret - secret to be created, consisting of a key/value pair
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the secret has been successfully created)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn delete_secret(&self, secret_id: &str) -> DshApiResult<()>

§Delete secret

API function: DELETE /allocation/{tenant}/secret/{id}/configuration

§Parameters
  • secret_id - id of the secret to delete
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the secret has been successfully deleted)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_secret(&self, secret_id: &str) -> DshApiResult<String>

§Return secret

API function: GET /allocation/{tenant}/secret/{id}

§Parameters
  • secret_id - id of the requested secret
§Returns
  • Ok<String> - secret
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_secret_allocation_status( &self, secret_id: &str, ) -> DshApiResult<AllocationStatus>

§Return secret allocation status

API function: GET /allocation/{tenant}/secret/{id}/status

§Parameters
  • secret_id - id of the requested secret
§Returns
Source

pub async fn get_secret_configuration( &self, secret_id: &str, ) -> DshApiResult<Empty>

§Return configuration of secret

API function: GET /allocation/{tenant}/secret/{id}/configuration

§Parameters
  • secret_id - id of the requested secret
§Returns
  • Ok<Empty> - indicates that secret is ok, but the return value will be empty
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_secret_with_usage( &self, secret_id: &str, ) -> DshApiResult<Vec<UsedBy>>

§Get secrets with usage

Returns configuration and usage for a given secret.

§Parameters
  • secret_id - id of the requested secrets
§Returns
  • Ok<Vec<UsedBy>> - usage.
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_secret_ids(&self) -> DshApiResult<Vec<String>>

§Return sorted list of secret names

API function: GET /allocation/{tenant}/secret

§Returns
  • Ok<Vec<String>> - list of secret names
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_secrets_with_usage( &self, ) -> DshApiResult<Vec<(String, Vec<UsedBy>)>>

§List all secrets with usage

Returns a list of all secrets together with the apps and applications that use them.

§Returns
  • Ok<Vec<(String, Vec<UsedBy>>> - list of tuples containing the secret id and a vector of usages, which can be empty.
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn update_secret( &self, secret_id: &str, secret: String, ) -> DshApiResult<()>

§Update secret value

API function: PUT /allocation/{tenant}/secret/{id}

§Parameters
  • secret_id - id of the secret to update
  • secret - new value of the secret
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the secret has been successfully updated)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source§

impl DshApiClient<'_>

§Manage internal and public Kafka streams

Module that contains functions to manage internal and public Kafka streams.

Source

pub async fn create_internal_stream( &self, stream_id: &str, configuration: &InternalManagedStream, ) -> DshApiResult<()>

§Create internal stream

API function: POST /manage/{manager}/stream/internal/{streamId}/configuration

§Parameters
  • stream_id - name of the internal created stream
  • configuration - configuration for the created internal stream
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the stream has been successfully created)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn create_public_stream( &self, stream_id: &str, configuration: &PublicManagedStream, ) -> DshApiResult<()>

§Create public stream

API function: POST /manage/{manager}/stream/public/{streamId}/configuration

§Parameters
  • stream_id - name of the public created stream
  • configuration - configuration for the created public stream
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the stream has been successfully created)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn delete_internal_stream(&self, stream_id: &str) -> DshApiResult<()>

§Delete internal stream

API function: DELETE /manage/{manager}/stream/internal/{streamId}/configuration

§Parameters
  • stream_id - name of the internal stream to delete
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the stream has been successfully deleted)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn delete_public_stream(&self, stream_id: &str) -> DshApiResult<()>

§Delete public stream

API function: DELETE /manage/{manager}/stream/public/{streamId}/configuration

§Parameters
  • stream_id - name of the public stream to delete
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the stream has been successfully deleted)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_internal_stream( &self, stream_id: &str, ) -> DshApiResult<InternalManagedStream>

§Return internal stream configuration

API function: GET /manage/{manager}/stream/internal/{streamId}/configuration

§Parameters
  • stream_id - name of the requested internal stream
§Returns
Source

pub async fn get_internal_streams( &self, ) -> DshApiResult<HashMap<String, InternalManagedStream>>

§Return internal stream configurations as a HashMap

API function: GET /manage/{manager}/stream API function: GET /manage/{manager}/stream/internal/{streamId}/configuration

§Returns
  • Ok<HashMap<>> - internal stream configurations
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_public_stream( &self, stream_id: &str, ) -> DshApiResult<PublicManagedStream>

§Return public stream configuration

API function: GET /manage/{manager}/stream/public/{streamId}/configuration

§Parameters
  • stream_id - name of the requested public stream
§Returns
Source

pub async fn get_public_streams( &self, ) -> DshApiResult<HashMap<String, PublicManagedStream>>

§Return public stream configurations as a HashMap

API function: GET /manage/{manager}/stream API function: GET /manage/{manager}/stream/public/{streamId}/configuration

§Returns
  • Ok<HashMap<>> - public stream configurations
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_stream_ids(&self) -> DshApiResult<Vec<String>>

§Return sorted list of internal and public stream names

API function: GET /manage/{manager}/stream

§Returns
  • Ok<Vec<String>> - list of stream names
  • Err<DshApiError> - when the request could not be processed by the DSH
Source§

impl DshApiClient<'_>

§Manage Kafka topics

Module that contains functions to manage Kafka topics.

Source

pub async fn create_topic( &self, topic_id: &str, configuration: &Topic, ) -> DshApiResult<()>

§Create topic

API function: PUT /allocation/{tenant}/topic/{id}/configuration

§Parameters
  • topic_id - name of the created topic
  • configuration - configuration for the created topic
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the topic has been successfully created)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn delete_topic(&self, topic_id: &str) -> DshApiResult<()>

§Delete topic

API function: DELETE /allocation/{tenant}/topic/{id}/configuration

§Parameters
  • topic_id - name of the topic to delete
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the topic has been successfully deleted)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_topic(&self, topic_id: &str) -> DshApiResult<TopicStatus>

§Return topic

API function: GET /allocation/{tenant}/topic/{id}

§Parameters
  • topic_id - name of the requested topic
§Returns
Source

pub async fn get_topic_allocation_status( &self, topic_id: &str, ) -> DshApiResult<AllocationStatus>

§Return topic allocation status

API function: GET /allocation/{tenant}/topic/{id}/status

§Parameters
  • topic_id - name of the requested topic
§Returns
Source

pub async fn get_topic_configuration( &self, topic_id: &str, ) -> DshApiResult<Topic>

§Return topic configuration

API function: GET /allocation/{tenant}/topic/{id}/configuration

§Parameters
  • topic_id - name of the requested topic
§Returns
  • Ok<Topic> - topic configuration
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_topic_ids(&self) -> DshApiResult<Vec<String>>

§Return sorted list of topic names

API function: GET /allocation/{tenant}/topic

§Returns
  • Ok<Vec<String>> - list of topic names
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_topics_with_usage( &self, ) -> DshApiResult<Vec<(String, Vec<UsedBy>)>>

§List all topics with usage

Returns a list of all topics together with the apps and applications that use them.

§Returns
  • Ok<Vec<(String, Vec<UsedBy>>> - list of tuples containing the topic id and a vector of usages, which can be empty.
  • Err<DshApiError> - when the request could not be processed by the DSH
Source§

impl DshApiClient<'_>

Source

pub async fn list_vhosts_with_usage( &self, ) -> DshApiResult<Vec<(String, Vec<UsedBy>)>>

§Get vhost with usage

Returns usage for a given vhost.

§Parameters
  • vhost_id - name of the requested vhost
§Returns
  • Ok<Vec<UsedBy>> - vhost usage.
  • Err<DshApiError> - when the request could not be processed by the DSH
§Get all vhost injections from Application
§Parameters
  • application - reference to the Application
§Returns

Vec<(String, Vec<UsedBy>)> - list of tuples that describe the vhost injections. Each tuple consist of

  • vhost id
  • vhost usage
Source§

impl DshApiClient<'_>

§Manage volumes

Module that contains methods and functions to manage volumes.

  • API methods - DshApiClient methods that directly call the API.
  • Derived methods - DshApiClient methods that add extra capabilities but depend on the API methods.

§API methods

DshApiClient methods that directly call the DSH resource management API.

§Derived methods

DshApiClient methods that add extra capabilities but do not directly call the DSH resource management API. These derived methods depend on the API methods for this.

Source

pub async fn create_volume( &self, volume_id: &str, configuration: &Volume, ) -> DshApiResult<()>

§Create volume

API function: PUT /allocation/{tenant}/volume/{id}/configuration

§Parameters
  • volume_id - name of the created volume
  • configuration - configuration for the created volume
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the volume has been successfully created)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn delete_volume(&self, volume_id: &str) -> DshApiResult<()>

§Delete volume

API function: DELETE /allocation/{tenant}/volume/{id}/configuration

§Parameters
  • volume_id - name of the volume to delete
§Returns
  • Ok(()) - when DSH has properly received the request (note that this does not mean that the volume has been successfully deleted)
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_volume(&self, volume_id: &str) -> DshApiResult<VolumeStatus>

§Return volume

API function: GET /allocation/{tenant}/volume/{id}

§Parameters
  • volume_id - name of the requested volume
§Returns
Source

pub async fn get_volume_allocation_status( &self, volume_id: &str, ) -> DshApiResult<AllocationStatus>

§Return volume allocation status

API function: GET /allocation/{tenant}/volume/{id}/status

§Parameters
  • volume_id - name of the requested volume
§Returns
Source

pub async fn get_volume_configuration( &self, volume_id: &str, ) -> DshApiResult<Volume>

§Return volume configuration

API function: GET /allocation/{tenant}/volume/{id}/configuration

§Parameters
  • volume_id - name of the requested volume
§Returns
  • Ok<Volume> - volume configuration
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_volume_ids(&self) -> DshApiResult<Vec<String>>

§Return sorted list of volume names

API function: GET /allocation/{tenant}/volume

§Returns
  • Ok<Vec<String>> - list of volume names
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn get_volume_with_usage( &self, volume_id: &str, ) -> DshApiResult<(VolumeStatus, Vec<UsedBy>)>

§Get volume with usage

Returns configuration and usage for a given volume.

§Parameters
  • volume_id - name of the requested volume
§Returns
  • Ok<(VolumeStatus, Vec<UsedBy>)> - volume status and usage.
  • Err<DshApiError> - when the request could not be processed by the DSH
Source

pub async fn list_volumes_with_usage( &self, ) -> DshApiResult<Vec<(String, Vec<UsedBy>)>>

§List all volumes with usage

Returns a list of all volumes together with the apps and applications that use them.

§Returns
  • Ok<Vec<(String, Vec<UsedBy>>> - list of tuples containing the secret id and a vector of usages, which can be empty.
  • Err<DshApiError> - when the request could not be processed by the DSH

Trait Implementations§

Source§

impl<'a> Debug for DshApiClient<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for DshApiClient<'a>

§

impl<'a> !RefUnwindSafe for DshApiClient<'a>

§

impl<'a> Send for DshApiClient<'a>

§

impl<'a> Sync for DshApiClient<'a>

§

impl<'a> Unpin for DshApiClient<'a>

§

impl<'a> !UnwindSafe for DshApiClient<'a>

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.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T