Skip to content

Use legacy destination helper in legacy destination create APIs

What does this MR do and why?

Uses the helper created in this MR !175628 (merged)

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

To test:

  • Checkout this branch locally, update migrations, and open gdk -- Ensure you have an Ultimate/EE license

  • Enable the feature flag audit_events_external_destination_streamer_consolidation_refactor

  • For legacy -> stream destination: you can use the UI following the documentation here to do so:

  • To test the reverse flow, open http://localhost:3000/-/graphql-explorer on your gdk instance.

EX:

mutation CreateInstanceAuditEventStreamingDestination {
  instanceAuditEventStreamingDestinationsCreate(
    input: {
      config: {
        googleProjectIdName: "google-project-id-name",
        clientEmail: "clientEmail@example.com",
        logIdName: "gcp-log-id-name"
      }, 
      category: "gcp", 
      name: "Test Local Destination API GCP 12345"
      secretToken:"SecretToken12345!" # required
    }
  ) {
    externalAuditEventDestination {
      id
      name
      category
      config
      secretToken
    }
    errors
  }
}
mutation CreateGroupAuditEventStreamingDestination {
  groupAuditEventStreamingDestinationsCreate(
    input: {
      groupPath:"twitter",
      config: {
        googleProjectIdName: "google-project-id-name",
        clientEmail: "clientEmail@example.com",
        logIdName: "gcp-log-id-name"
      }, 
      category: "gcp", 
      name: "Test Local Destination API GCP 12345"
      secretToken:"SecretToken12345!" # required
    }
  ) {
    externalAuditEventDestination {
      id
      name
      group {
        fullName
        fullPath
      }
      category
      config
      secretToken
    }
    errors
  }
}

Configs are different for each category, and they can be found from their json schemas here:

Example demo where I create a new streaming model through API -> it shows up as a legacy destination as well: Screen_Recording_2024-12-04_at_2.00.12_PM

Example demo where I create a legacy instance destination for HTTP and it shows up as a stream destination via API: Screen_Recording_2024-12-04_at_2.05.40_PM

Edited by Andrew Jung

Merge request reports

Loading