mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 07:19:00 +08:00
chore: cloud integrations: include cloud account id in account status response (#6833)
This commit is contained in:
parent
92299e1b08
commit
8e11a988be
@ -127,8 +127,9 @@ func (c *Controller) GenerateConnectionUrl(
|
||||
}
|
||||
|
||||
type AccountStatusResponse struct {
|
||||
Id string `json:"id"`
|
||||
Status AccountStatus `json:"status"`
|
||||
Id string `json:"id"`
|
||||
CloudAccountId *string `json:"cloud_account_id,omitempty"`
|
||||
Status AccountStatus `json:"status"`
|
||||
}
|
||||
|
||||
func (c *Controller) GetAccountStatus(
|
||||
@ -146,8 +147,9 @@ func (c *Controller) GetAccountStatus(
|
||||
}
|
||||
|
||||
resp := AccountStatusResponse{
|
||||
Id: account.Id,
|
||||
Status: account.status(),
|
||||
Id: account.Id,
|
||||
CloudAccountId: account.CloudAccountId,
|
||||
Status: account.status(),
|
||||
}
|
||||
|
||||
return &resp, nil
|
||||
|
@ -52,6 +52,7 @@ func TestAWSIntegrationAccountLifecycle(t *testing.T) {
|
||||
accountStatusResp := testbed.GetAccountStatusFromQS("aws", testAccountId)
|
||||
require.Equal(testAccountId, accountStatusResp.Id)
|
||||
require.Nil(accountStatusResp.Status.Integration.LastHeartbeatTsMillis)
|
||||
require.Nil(accountStatusResp.CloudAccountId)
|
||||
|
||||
// The unconnected account should not show up in connected accounts list yet
|
||||
accountsListResp1 := testbed.GetConnectedAccountsListFromQS("aws")
|
||||
@ -75,6 +76,8 @@ func TestAWSIntegrationAccountLifecycle(t *testing.T) {
|
||||
// Polling for connection status from UI should now return latest status
|
||||
accountStatusResp1 := testbed.GetAccountStatusFromQS("aws", testAccountId)
|
||||
require.Equal(testAccountId, accountStatusResp1.Id)
|
||||
require.NotNil(accountStatusResp1.CloudAccountId)
|
||||
require.Equal(testAWSAccountId, *accountStatusResp1.CloudAccountId)
|
||||
require.NotNil(accountStatusResp1.Status.Integration.LastHeartbeatTsMillis)
|
||||
require.LessOrEqual(
|
||||
tsMillisBeforeAgentCheckIn,
|
||||
|
Loading…
x
Reference in New Issue
Block a user