Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discover gcp metadata #43

Merged
merged 3 commits into from
Jun 14, 2022
Merged

Discover gcp metadata #43

merged 3 commits into from
Jun 14, 2022

Conversation

arbulu89
Copy link
Contributor

@arbulu89 arbulu89 commented Jun 13, 2022

Discovery GCP metadata.

Pretty straightforward implementation. Basically, query the metadata in the local endpoint, and transform to our dto so it is easy to consume.

Find GCP metadata information here:
https://cloud.google.com/compute/docs/metadata/overview
https://cloud.google.com/compute/docs/metadata/querying-metadata

I have not specified all the coming fields in the metadata in our decoding code, only the used ones.

This would be the result payload:

{"agent_id":"some-id","discovery_type":"cloud_discovery","payload":{"Provider":"gcp","Metadata":{"disk_number":4,"image":"sles-15-sp1-sap-byos-v20220126","instance_name":"vmhana01","machine_type":"n1-highmem-8","network":"network","project_id":"123456","zone":"europe-west1-b"}}}

PD: Besides that, I have cleaned up a bit how azure payload fixture were used in the tests.

@arbulu89 arbulu89 force-pushed the discover-gcp-metadata branch from 78a295f to d7a603b Compare June 13, 2022 12:22
Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @arbulu89 !
MOAR providers 😄

Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arbulu89 arbulu89 merged commit e6af40e into main Jun 14, 2022
@stefanotorresi stefanotorresi deleted the discover-gcp-metadata branch August 17, 2022 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

3 participants