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!

    Are the API endpoints for keyword "packages" still valid in 6.1.0?

    Scheduled Pinned Locked Moved Support
    apibuildmaster
    4 Posts 2 Posters 15 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.
    • D Offline
      dwynn_6489
      last edited by

      In the notes for BM-3257 it says "Things not changed: Release & Package Deployment API". However, when I upgraded from BM 6.0.9 to 6.1.0, my implementation of /releases/packages/deploy stopped working. To get it working I needed to change the variable name in the body from "packageNumber" to "buildNumber".

      I also noticed that the on-line documentation only mentions endpoints using the "build" keyword, like releases/builds/deploy. There is no mention of a packages endpoint (https://inedo.com/support/documentation/buildmaster/reference/api/release-and-package)

      Were the /packages/ endpoints deprecated in a prior release?

      Product: BuildMaster
      Version: 6.1.0

      1 Reply Last reply Reply Quote 0
      • jraschJ Offline
        jrasch inedo-engineer
        last edited by

        Both are supposed to be supported, and quickly inspecting the code itself, I see both as possible arguments:

        isMatch("builds") || isMatch("packages")

        and

        BuildId = AH.ParseInt(request["buildId"] ?? request["packageId"]),
        BuildNumber = request["buildNumber"] ?? request["packageNumber"],
        

        Perhaps it's JSON parsing related? Are you POSTing as application/json?

        1 Reply Last reply Reply Quote 0
        • D Offline
          dwynn_6489
          last edited by

          Thanks for getting back to me. Yes, I'm posting using the application/json content type. Below is a powershell code sample that illustrates the issue.

          # this creates the package.
          $body = "{
              applicationId: ""${APP}"",
              releaseNumber: ""${RELNUM}"",   
              API_key: ""${APIKey}""
          }"
          
          $results = (Invoke-WebRequest -Uri "http://${Servername}:81/api/releases/packages/create" -Method Post -Body $body -ContentType "application/json" -UseBasicParsing).content | ConvertFrom-Json
          $PackageNumber = $results.number
          
          # this fails with a message of "Could not determine build ID. A build id or build number, release id/name, application id/name is required."
          $body = "{
              applicationId: ""${APP}"",
              releaseNumber: ""${RELNUM}"",
              packageNumber: ""${PackageNumber}"",   
              API_key: ""${APIKey}"",
              toStage: ""Run""
          }"	
          Invoke-WebRequest -Uri "http://${Servername}:81/api/releases/packages/deploy" -Method Post -Body $body -ContentType "application/json" -UseBasicParsing
          
          # change the var name from "packageNumber" to "buildNumber" in the body and it works.
          $body = "{
              applicationId: ""${APP}"",
              releaseNumber: ""${RELNUM}"",
              buildNumber: ""${PackageNumber}"",   
              API_key: ""${APIKey}"",
              toStage: ""Run""
          }"	
          Invoke-WebRequest -Uri "http://${Servername}:81/api/releases/packages/deploy" -Method Post -Body $body -ContentType "application/json" -UseBasicParsing
          
          1 Reply Last reply Reply Quote 0
          • jraschJ Offline
            jrasch inedo-engineer
            last edited by

            Thanks, I've filed this as a bug here: BM-3307

            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