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