FAQs (Asset-Index)
General API questions
Q: How do I authenticate with the API ?
A: We use API key authentication. Pass your API key as a Token in the Authorization header like so: Authorization: token YOUR_API_KEY_HERE
Q: How do I get an API key?
A: Sign in to Netbox App and generate a new API key under your profile section.
Q: Why am I getting a 403 Forbidden error?
A: Make sure your API key is valid and included as a token in the Authorization header. Also check the URL if you are running against Netbox prepared environment make sure the key is generated through preprod environment.
Q: What content types are supported?
A: We support application/json for both request and response bodies.
Questions on Platform-Inventory Pull requests
Q: Change in the order and notes string of the other server allocations ?
A: This happens due to platform-inventory being written through code and code has set these attributes in specific order. You would also see notes being written in a single line. It does not make any difference in the data. Data is validated through CI checks.
Q: I did not have any changes in the data I supplied in the API then also PR got raised and merged, Why ?
A: You might see job succeeded PR raised and merged in platform-inventory but actually there is no change, because the changes you see would be just order changes or notes string being converted to one line.
Q: How do we make sure the data backend code is going to write in platform-inventory is latest ?
A: We are pulling the latest before we start executing the API flow. And if something got merged in the middle of the execution in platform-inventory, we have a proper error handling and with that we will start from the beginning in the second attempt.
Questions on API payload -
Q: What if mandatory parameters missed in the API payload ?
A: For example when ‘hostname’ is missed in server allocation’s patch, post or delete payload. You will see below error in the jobs results. It is because hostname is the unique identifier for server-object being created/updated or deleted and same goes for rack and other allocations.
Q: What if I supplied wrong data in the API payload ?
A: Don’t worry, It will be validated through CI checks in the backend before merging.
Questions on API results -
Q: What are below errors ?
A: Travis CI checks failed (Basically validation applied against the data pushed by user through plugin). Below failure shows the data user has provided in the API have some issue(s).
Few examples :
• OOB management CIDR range is either missing in given rack allocations or is already being used in other racks.
• Server missing its corresponding rack allocation. Please create the rack first.
Questions on PR failures in job results
Q: What do you mean by PR creation or approval failed ?
A: As we know we are pushing data in Platform-inventory git repo in the backend. We are using Github APIs to create, approve and merge PRs. Although we’re using correct tokens to do so but if there is something wrong with the token(token expired) or payload you would see these errors. If there are some other issues like network, session timeouts etc, we have retry logic in place.
Q: What is AutoMergePR failed ?
A: There can be multiple reasons for this - • PR blocked for long • PR got behind since other commited between the process. • PR has merge conflicts.
Q: What is Task exceeded maximum timeout value (600 seconds) ?
A: We have API timeout set to 10mins. If job does not finish within the limits it will fail with the below error. This can happen if PR is blocked for long to get approved or network lag. Also if PR was blocked for long and when it get approve it is already behind due to others commited to the repo and therefore it will retry again and the whole process took more than timeout value.