AWS IoT Device SDK C++ v2  1.34.0
AWS IoT Device SDK C++ v2
Public Member Functions | List of all members
Aws::Crt::Imds::ImdsClient Class Reference

#include <ImdsClient.h>

Public Member Functions

 ImdsClient (const ImdsClientConfig &config, Allocator *allocator=ApiAllocator()) noexcept
 
 ~ImdsClient ()
 
 ImdsClient (const ImdsClient &)=delete
 
 ImdsClient (ImdsClient &&)=delete
 
ImdsClientoperator= (const ImdsClient &)=delete
 
ImdsClientoperator= (ImdsClient &&)=delete
 
aws_imds_client * GetUnderlyingHandle ()
 
int GetResource (const StringView &resourcePath, OnResourceAcquired callback, void *userData)
 
int GetAmiId (OnResourceAcquired callback, void *userData)
 
int GetAmiLaunchIndex (OnResourceAcquired callback, void *userData)
 
int GetAmiManifestPath (OnResourceAcquired callback, void *userData)
 
int GetAncestorAmiIds (OnVectorResourceAcquired callback, void *userData)
 
int GetInstanceAction (OnResourceAcquired callback, void *userData)
 
int GetInstanceId (OnResourceAcquired callback, void *userData)
 
int GetInstanceType (OnResourceAcquired callback, void *userData)
 
int GetMacAddress (OnResourceAcquired callback, void *userData)
 
int GetPrivateIpAddress (OnResourceAcquired callback, void *userData)
 
int GetAvailabilityZone (OnResourceAcquired callback, void *userData)
 
int GetProductCodes (OnResourceAcquired callback, void *userData)
 
int GetPublicKey (OnResourceAcquired callback, void *userData)
 
int GetRamDiskId (OnResourceAcquired callback, void *userData)
 
int GetReservationId (OnResourceAcquired callback, void *userData)
 
int GetSecurityGroups (OnVectorResourceAcquired callback, void *userData)
 
int GetBlockDeviceMapping (OnVectorResourceAcquired callback, void *userData)
 
int GetAttachedIamRole (OnResourceAcquired callback, void *userData)
 
int GetCredentials (const StringView &iamRoleName, OnCredentialsAcquired callback, void *userData)
 
int GetIamProfile (OnIamProfileAcquired callback, void *userData)
 
int GetUserData (OnResourceAcquired callback, void *userData)
 
int GetInstanceSignature (OnResourceAcquired callback, void *userData)
 
int GetInstanceInfo (OnInstanceInfoAcquired callback, void *userData)
 

Constructor & Destructor Documentation

◆ ImdsClient() [1/3]

Aws::Crt::Imds::ImdsClient::ImdsClient ( const ImdsClientConfig config,
Allocator allocator = ApiAllocator() 
)
noexcept

◆ ~ImdsClient()

Aws::Crt::Imds::ImdsClient::~ImdsClient ( )

◆ ImdsClient() [2/3]

Aws::Crt::Imds::ImdsClient::ImdsClient ( const ImdsClient )
delete

◆ ImdsClient() [3/3]

Aws::Crt::Imds::ImdsClient::ImdsClient ( ImdsClient &&  )
delete

Member Function Documentation

◆ GetAmiId()

int Aws::Crt::Imds::ImdsClient::GetAmiId ( OnResourceAcquired  callback,
void *  userData 
)

Gets the ami id of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetAmiLaunchIndex()

int Aws::Crt::Imds::ImdsClient::GetAmiLaunchIndex ( OnResourceAcquired  callback,
void *  userData 
)

Gets the ami launch index of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetAmiManifestPath()

int Aws::Crt::Imds::ImdsClient::GetAmiManifestPath ( OnResourceAcquired  callback,
void *  userData 
)

Gets the ami manifest path of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetAncestorAmiIds()

int Aws::Crt::Imds::ImdsClient::GetAncestorAmiIds ( OnVectorResourceAcquired  callback,
void *  userData 
)

Gets the list of ancestor ami ids of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetAttachedIamRole()

int Aws::Crt::Imds::ImdsClient::GetAttachedIamRole ( OnResourceAcquired  callback,
void *  userData 
)

Gets the attached iam role of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetAvailabilityZone()

int Aws::Crt::Imds::ImdsClient::GetAvailabilityZone ( OnResourceAcquired  callback,
void *  userData 
)

Gets the availability zone of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetBlockDeviceMapping()

int Aws::Crt::Imds::ImdsClient::GetBlockDeviceMapping ( OnVectorResourceAcquired  callback,
void *  userData 
)

Gets the list of block device mappings of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetCredentials()

int Aws::Crt::Imds::ImdsClient::GetCredentials ( const StringView iamRoleName,
OnCredentialsAcquired  callback,
void *  userData 
)

Gets temporary credentials based on the attached iam role of the ec2 instance

Parameters
iamRoleNameiam role name to get temporary credentials through
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetIamProfile()

int Aws::Crt::Imds::ImdsClient::GetIamProfile ( OnIamProfileAcquired  callback,
void *  userData 
)

Gets the iam profile information of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetInstanceAction()

int Aws::Crt::Imds::ImdsClient::GetInstanceAction ( OnResourceAcquired  callback,
void *  userData 
)

Gets the instance-action of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetInstanceId()

int Aws::Crt::Imds::ImdsClient::GetInstanceId ( OnResourceAcquired  callback,
void *  userData 
)

Gets the instance id of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetInstanceInfo()

int Aws::Crt::Imds::ImdsClient::GetInstanceInfo ( OnInstanceInfoAcquired  callback,
void *  userData 
)

Gets the instance information data block of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetInstanceSignature()

int Aws::Crt::Imds::ImdsClient::GetInstanceSignature ( OnResourceAcquired  callback,
void *  userData 
)

Gets the signature of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetInstanceType()

int Aws::Crt::Imds::ImdsClient::GetInstanceType ( OnResourceAcquired  callback,
void *  userData 
)

Gets the instance type of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetMacAddress()

int Aws::Crt::Imds::ImdsClient::GetMacAddress ( OnResourceAcquired  callback,
void *  userData 
)

Gets the mac address of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetPrivateIpAddress()

int Aws::Crt::Imds::ImdsClient::GetPrivateIpAddress ( OnResourceAcquired  callback,
void *  userData 
)

Gets the private ip address of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetProductCodes()

int Aws::Crt::Imds::ImdsClient::GetProductCodes ( OnResourceAcquired  callback,
void *  userData 
)

Gets the product codes of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetPublicKey()

int Aws::Crt::Imds::ImdsClient::GetPublicKey ( OnResourceAcquired  callback,
void *  userData 
)

Gets the public key of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetRamDiskId()

int Aws::Crt::Imds::ImdsClient::GetRamDiskId ( OnResourceAcquired  callback,
void *  userData 
)

Gets the ramdisk id of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetReservationId()

int Aws::Crt::Imds::ImdsClient::GetReservationId ( OnResourceAcquired  callback,
void *  userData 
)

Gets the reservation id of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetResource()

int Aws::Crt::Imds::ImdsClient::GetResource ( const StringView resourcePath,
OnResourceAcquired  callback,
void *  userData 
)

Queries a generic resource (string) from the ec2 instance metadata document

Parameters
resourcePathpath of the resource to query
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetSecurityGroups()

int Aws::Crt::Imds::ImdsClient::GetSecurityGroups ( OnVectorResourceAcquired  callback,
void *  userData 
)

Gets the list of the security groups of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ GetUnderlyingHandle()

aws_imds_client* Aws::Crt::Imds::ImdsClient::GetUnderlyingHandle ( )
inline

◆ GetUserData()

int Aws::Crt::Imds::ImdsClient::GetUserData ( OnResourceAcquired  callback,
void *  userData 
)

Gets the user data of the ec2 instance from the instance metadata document

Parameters
callbackcallback function to invoke on query success or failure
userDataopaque data to invoke the completion callback with
Returns
AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise

◆ operator=() [1/2]

ImdsClient& Aws::Crt::Imds::ImdsClient::operator= ( const ImdsClient )
delete

◆ operator=() [2/2]

ImdsClient& Aws::Crt::Imds::ImdsClient::operator= ( ImdsClient &&  )
delete

The documentation for this class was generated from the following files: