Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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!

    Unexpected URL for feed after creating with /api/management/feeds/create and endpointURL

    Scheduled Pinned Locked Moved Support
    3 Posts 2 Posters 19 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B Offline
      bill.hertzing_2810
      last edited by atripp

      I'm trying to use ProGet as an internal package repository for my organization. I want to use it to test the packaging and delivery of modules in a variety of packaging formats and feed protocols
      I want to push PowerShell modules/packages that support Prerelease / Released kinds and Production / QualityAssurance kinds of packages.
      I want to push to feeds with protocols conforming to NuGet, PSResourceGet, and Chocolatey.

      I use a PowerShell script to create a set of HTTP (not HTTPS) feed endpoints for these 12 combinations, using the V3 protocol

      I use this command:
      $feedCreationResults = Invoke-RestMethod -Uri $feedAdministrationUri -Method Post -Headers $headers -Body ($body | ConvertTo-Json -Depth 3) -ContentType 'application/json'

      where:

      $feedAdministrationUri = "http://utat022:50000/api/management/feeds/create"
      $headers  = @{ 'X-ApiKey' = $adminApiKey }
      $body = @{
            name                      = 'IntRelPSProdPushFeed'
            alternateNames            = @()
            feedType                  = 'powershell'
            active                    = $true
            cacheConnectors           = $true
            symbolServerEnabled       = $false
            stripSymbols              = $false
            stripSource               = $false
            endpointUrl               = 'http://utat022:50000/Released/Production/powershell/v3/index.json' (the word powershell is also replaced by 'nuget' and 'chocolatey' for those feed endpoints)
            connectors                = @()
            retentionRules            = @()
            variables                 = @{}
            canPublish                = $true
            packageStatisticsEnabled  = $false
            restrictPackageStatistics = $false
            deploymentRecordsEnabled  = $true
            usageRecordsEnabled       = $true
            vulnerabilitiesEnabled    = $true
            licensesEnabled           = $true
            useWithProjects           = $true
          }
      

      Using the ProGet dashboard, I can see that all 12 feeds are being created with their appropriate feed names, but...

      When I inspect the feed at
      'http://localhost:50000/feeds/IntRelPSRProdPushFeed'
      it says the feed API endpoint URL is
      http://localhost:50000/nuget/IntRelPSRProdPushFeed/

      Regardless of the ProGet feed type I use in my endpointURL (nuget, powershell, chocolatey), the feed endpoint type in ProGet is always nuget, the feed endpoint host is always 'localhost', not 'utat022', and the subpaths are missing. The "supported API" is v2 for powershell and chocolatey feeds, and "v2 and v3" only for nuget feeds

      Furthermore, attempting the command
      Register-PSRepository -Name 'IntRelPSRProdPushFeed' -SourceLocation 'http://utat022:50000/Released/Production/powershell/v3/index.json'
      results in the message

      Register-PSRepository: The specified Uri 'http://utat022:50000/Released/Production/powershell/v3/index.json' for parameter 'SourceLocation' is an invalid Web Uri. Please ensure that it meets the Web Uri requirements.
      

      Could somebody point out what I'm doing wrong?

      atrippA 1 Reply Last reply Reply Quote 0
      • atrippA Offline
        atripp inedo-engineer @bill.hertzing_2810
        last edited by

        Hi @bill-hertzing_2810,

        It sounds like you want to enable API v3, which uses the `v3/index.json' URL suffix?

        In that case, make sure to set the useApiV3 property is set. Also, I don't think you can set all those properties on create... you may have to create, and then update.

        Also note that you cannot set the endpointUrl property, it's just readonly. That is generated based on the incoming reques, so if you're viewing it on localhost you'll see that. If you view it on myserver.corp you'll see that, etc.

        Hope that helps,
        Alana

        1 Reply Last reply Reply Quote 0
        • B Offline
          bill.hertzing_2810
          last edited by

          Thank you. Your comments clarified a few things. I added useApiV3 = $True to the body above, and removed the incorrect use of endpointUrl. The big mistake in the above was Register-PSRepository - I needed to update Microsoft.PowerShell.PSResourceGet to the latest version, and use Register-PSResourceRepository -Name $feed.ShortName -Uri $endpointUrl -ApiVersion 'V3' -Trusted -passthru, where endpointUrl was http://<hostname>:50000/nuget/$feed.ShortName/
          Problem solved, thanks again!

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            Last post
          Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation