Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Some API questions
-
Hi Guys,
We are currently evaluating the ent version of Proget and are having some questions about some functions we want automated though your API.
-
At this moment we are having trouble with automating the API Key creation for a customer and to attach this to the feed. This seems to be a manual action in the UI. Is this correct? Or do you have a secret API call that is not well documented or we missed?
-
The same goes for Feed Groups. We need to manual create a feed group for a Silo and add the ‘new’ customer feed to it though the UI. We would really like an API call for this! To create a Feed Group (manage it) and add feeds to it!
a.
-
API call to ‘pull’ a package (version) on a feed and perhaps delete as well.
a.
b. For every version added to the connector we need to pull a package to ‘approve’ that one for a specific customer feed or silo feed. This is great but not when this is a manual process in the UI. Would be great to do this through the API so we can integrate this in our own toolset.
Perhaps we are missing some documentation or info or we just want something that no one asked before, either way can you reply on above items and direct us to the right documentation or let us know if this is on the roadmap (and for when)
These are the last few items we need to get awnsered for our case.
Thanks you! Cheers, Marcel
-
-
Hi @mvanweel_2810 ,
I'm happy to point you to methods! Sorry that I don't have example scripts, but I hope this helps...
[1] This would require using the Native API method, specifically
ApiKeys_CreateOrUpdateApiKey
; we don't document the format ofApiKey_Configuration
, but it's pretty basic XML that you can figure out by creating other API Keys in the UI and looking at the value of the data[2] It looks like we don't expose these currently in any API; I can give you a "cheat code" to expose these in the Native API, so they will show up on
/reference/api
:update __StoredProcInfo set Internal_Indicator = 'N' where StoredProc_Name like 'FeedGroups%'
Please let me know if this API works for you, and I will mark them as public in a future maintenance release.
[3] "Pulling to ProGet" is the same thing as downloading and then uploading that package. That's effectively what the UI does. So, you can just do that with two calls to the Common Package API.
Please feel free to share your example scripts :) This is an area we really want to improve in our docs.
Cheers,
Alana
-
Great! We are sitting today for this project so will let you know how it goes. Ofc we will share what we can!
-
Hi @atripp ,
I'm working on this case together with Marcel.
I can confirm that you solution for [2] is working! After setting theInternal_Indicator
to N it shows up on the/reference/api
page. We've succesfully created, updated and deleted these groups.However your explanation for [3] doesn't seem to be right in our case. We're using the 'Pull to ProGet' button to download packages from an Azure DevOps Artifact to our ProGet feed, however when the package hasn't been downloaded yet it shows in the Feed with a Antenna icon.
.However if i use any of the
api/packages/<feed_name>
api's this package does not show up untill its manualy pulled.When i use the api endpoint to download the package i receive the following result.
Method: GET URI: api/packages/<feed_name>/download?name=<package_name>&version=<package_version>
Response:
Package pkg:nuget/<package_name>@<package_version> not found.
If I manualy use the "Pull to ProGet" button then it shows up and i get a different response on the download endpoint.
-
Addition: for [1]
We cannot get the endpoint
ApiKeys_CreateOrUpdateApiKey
to get to work. It seems that the JSON requiresApiKeyTasks_Table (IEnumerable
1)`. Unfortunately we cannot find what we have to provide here. If i look at the Stored Procedure, it seems that this cannot be filled with an API request.
-
@atripp This one would be very nice to solve. We don't want to create 600+ keys.....Would be great if you could help us with this.
-
Hi @k_2363,
However your explanation for [3] doesn't seem to be right in our case. We're using the 'Pull to ProGet' button to download packages from an Azure DevOps Artifact to our ProGet feed, however when the package hasn't been downloaded yet it shows in the Feed with a Antenna icon.
Actually this won't work with the Common Package API; this API works only with local packages, and does not query connectors. So instead, you'll need to download the package file from the NuGet endpoint (which does connectors).
You can find the download URL by looking in the front-end, and generating a file url from that. But it's basically like this for NuGet/chocolatey packages:
/nuget/<feed_name>/package/<package_name>/<package_version>
Best,
Steve
-
Hi @k_2363,
We cannot get the endpoint ApiKeys_CreateOrUpdateApiKey to get to work. It seems that the JSON requires ApiKeyTasks_Table (IEnumerable1)`. Unfortunately we cannot find what we have to provide here. If i look at the Stored Procedure, it seems that this cannot be filled with an API request.
Hmm, it looks like you may not be able to use table-value parameters via JSON. I don't know how easy that will be to add support for; one option is just to just do direct INSERT statements into
ApiKeys
andApiKeyTasks
tables. I'm aware of at least one other user that does that, since it was significantly easier to do a single statement that joined on another table in another database on the same SQL Server.It's not ideal, but this is pretty rare use case.
Would that work?
Thanks,
Steve