pub struct Sshkeys {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl Sshkeys
impl Sshkeys
Sourcepub async fn get_page(
&self,
limit: u32,
page_token: &str,
sort_by: NameSortMode,
) -> Result<Vec<SshKey>>
pub async fn get_page( &self, limit: u32, page_token: &str, sort_by: NameSortMode, ) -> Result<Vec<SshKey>>
List SSH public keys.
This function performs a GET
to the /session/me/sshkeys
endpoint.
Lists SSH public keys for the currently authenticated user.
Parameters:
limit: u32
– Maximum number of items returned by a single call.page_token: &str
– Token returned by previous call to retrieve the subsequent page.sort_by: crate::types::NameSortMode
– Supported set of sort modes for scanning by name only
Currently, we only support scanning in ascending order.
Sourcepub async fn get_all(&self, sort_by: NameSortMode) -> Result<Vec<SshKey>>
pub async fn get_all(&self, sort_by: NameSortMode) -> Result<Vec<SshKey>>
List SSH public keys.
This function performs a GET
to the /session/me/sshkeys
endpoint.
As opposed to get
, this function returns all the pages of the request at once.
Lists SSH public keys for the currently authenticated user.
Sourcepub async fn post(&self, body: &SshKeyCreate) -> Result<SshKey>
pub async fn post(&self, body: &SshKeyCreate) -> Result<SshKey>
Create an SSH public key.
This function performs a POST
to the /session/me/sshkeys
endpoint.
Create an SSH public key for the currently authenticated user.
Sourcepub async fn get_key(&self, ssh_key_name: &str) -> Result<SshKey>
pub async fn get_key(&self, ssh_key_name: &str) -> Result<SshKey>
Fetch an SSH public key.
This function performs a GET
to the /session/me/sshkeys/{ssh_key_name}
endpoint.
Fetch an SSH public key associated with the currently authenticated user.
Parameters:
ssh_key_name: &str
– Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and ‘-’, and may not end with a ‘-’. Names cannot be a UUID though they may contain a UUID.
Sourcepub async fn delete_key(&self, ssh_key_name: &str) -> Result<()>
pub async fn delete_key(&self, ssh_key_name: &str) -> Result<()>
Delete an SSH public key.
This function performs a DELETE
to the /session/me/sshkeys/{ssh_key_name}
endpoint.
Delete an SSH public key associated with the currently authenticated user.
Parameters:
ssh_key_name: &str
– Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and ‘-’, and may not end with a ‘-’. Names cannot be a UUID though they may contain a UUID.