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!
Create Choco feed with the API
-
Hi Guys,
Just wondering, is there an API function to create chocolatey feeds? i cant seem to find it in the doco.
thanks,
Clint
Product: ProGet
Version: 5.0.8
-
Hello Clint,
To do this, you would need to use the native API. For example:
(newlines inserted for readability. they would not be in the actual request.)
POST /api/json/Feeds_CreateFeed HTTP/1.1 Content-Type: application/x-www-form-urlencoded key=[your native API key]& Feed_Name=[feed name]& FeedType_Name=Chocolatey& FeedConfiguration_Xml=%3CInedo.ProGet.Feeds.NuGet.NuGetFeedConfig%20Assembly%3D%22ProGetCoreEx%22%3E %3CProperties%20UseLegacyVersioning%3D%22False%22%20%2F%3E %3C%2FInedo.ProGet.Feeds.NuGet.NuGetFeedConfig%3E
The easiest way to get a value for FeedConfiguration_Xml is to configure a feed in ProGet and then copy that column from the database.
-
Fantastic, thanks Ben. Get that to work OK - however when I then try to call the promotions api to promote, it returns the Native JSON API Reference instead of actually doing anything.
POST /api/json/promotions/promote HTTP/1.1
Host: proget.server
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache
Postman-Token: 109411c1-d1b5-81f7-603f-be2c9901a42fkey=BjvV78liayx7CEay6O1Y%2Bg%3D%3D&packageName=QCAD.ARL.Service&fromFeed=QCAD&toFeed=NewFeed
going to /api/promotions/promote as per the doco just returns a 500 error
thoughts?
thanks,
Clint
-
Sorry, I did get it working, didn't see that 'version' was required. is there any way to just promote 'latest' rather than a named version?
-
Good idea ... in 5.0.9, there should be! I just added PG-1216, and assuming there are no issues with it, we'll ship it.
-
Outstanding, thanks Alex