pub struct KeyPairClient { /* private fields */ }Expand description
Calls KeyPairService.
Key pairs: SSH public keys an instance installs for its login user at launch. A key pair belongs to its project and can be used in every zone. Import a key you have, or have the platform generate one and return its private key once.
Implementations§
Source§impl KeyPairClient
impl KeyPairClient
Sourcepub fn new(client: &Client) -> Self
pub fn new(client: &Client) -> Self
Returns a client of KeyPairService that sends its calls through client.
Sourcepub fn service(&self) -> &Service
pub fn service(&self) -> &Service
The endpoint the client sends its calls to, which also serves the operations its methods answer with.
Sourcepub async fn get_key_pair(
&self,
request: GetKeyPairRequest,
) -> Result<KeyPair, Error>
pub async fn get_key_pair( &self, request: GetKeyPairRequest, ) -> Result<KeyPair, Error>
Returns a key pair, its public key only.
Sourcepub async fn list_key_pairs(
&self,
request: ListKeyPairsRequest,
) -> Result<ListKeyPairsResponse, Error>
pub async fn list_key_pairs( &self, request: ListKeyPairsRequest, ) -> Result<ListKeyPairsResponse, Error>
Lists a project’s key pairs, oldest first.
Sourcepub fn all_key_pairs(&self, request: ListKeyPairsRequest) -> Pages<KeyPair>
pub fn all_key_pairs(&self, request: ListKeyPairsRequest) -> Pages<KeyPair>
Returns everything list_key_pairs lists from request’s page on, fetching the next page as the stream reaches it. A page that fails ends the stream with its error.
Sourcepub async fn create_key_pair(
&self,
request: CreateKeyPairRequest,
) -> Result<KeyPair, Error>
pub async fn create_key_pair( &self, request: CreateKeyPairRequest, ) -> Result<KeyPair, Error>
Creates a key pair: imports public_key, or, left empty, generates an
ssh-ed25519 key and returns its private half in private_key, in
this response only. A repeat of a generating request with the same
request_id can’t return the private key again, and is refused with
FAILED_PRECONDITION: delete the key pair and create another.
Sourcepub async fn update_key_pair(
&self,
request: UpdateKeyPairRequest,
) -> Result<KeyPair, Error>
pub async fn update_key_pair( &self, request: UpdateKeyPairRequest, ) -> Result<KeyPair, Error>
Changes a key pair’s tags.
Sourcepub async fn delete_key_pair(
&self,
request: DeleteKeyPairRequest,
) -> Result<Empty, Error>
pub async fn delete_key_pair( &self, request: DeleteKeyPairRequest, ) -> Result<Empty, Error>
Deletes a key pair. Instances launched with it keep the key installed.