Communicating with API from CI/CD (GitLab) #8754
-
I have a nodeJS script that connects my company's netbox site to a Google Sheet that I use as a front end for an internal app. It works when I run on my computer, but when its automated in a pipeline, it won't connect. I'm wondering if its because its not an allowed host. Can anybody lead me to the right path here? Do I need to make a request from our system admin about something? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Check what HTTP status code is returned to the CI/CD request, and what is in the body. That will probably tell you all you need to know. If Gitlab doesn't record this info (and it would be broken if it doesn't) then at worst you can use tcpdump on the Netbox server to capture it:
... although you'll have all your other Netbox activity mixed in. "Allowed hosts" is the list of server names that the Netbox server can be accessed as. That is, if your server is 1.2.3.4, and in the DNS you've mapped netbox.example.com to 1.2.3.4, and ALLOWED_HOSTS is "netbox.example.com", it means that clients are allowed to make requests to |
Beta Was this translation helpful? Give feedback.
-
After thinking about this further, I think my mistake here is that I am trying to connect a publicly hosted service (Gitlab pipeline) to a tool hosted on a private server. I actually hadn't realized that Netbox was just a private tool on our servers, and wasn't a public site. I was confused bc it has such an extensive rest API. I don't use it all that often. So, obviously when GitLab requests the restAPI, it doesn't have any resolution for the domain name, and doesn't know where to go. Honestly, I'm surprised that Netbox has an http API that is so robust, considering its only accessed within private domains. I'll have to figure out what people do in these situations normally. |
Beta Was this translation helpful? Give feedback.
After thinking about this further, I think my mistake here is that I am trying to connect a publicly hosted service (Gitlab pipeline) to a tool hosted on a private server. I actually hadn't realized that Netbox was just a private tool on our servers, and wasn't a public site. I was confused bc it has such an extensive rest API. I don't use it all that often. So, obviously when GitLab requests the restAPI, it doesn't have any resolution for the domain name, and doesn't know where to go. Honestly, I'm surprised that Netbox has an http API that is so robust, considering its only accessed within private domains. I'll have to figure out what people do in these situations normally.