Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get no results when using two query params. #4270

Closed
ameowlia opened this issue Mar 18, 2025 · 1 comment
Closed

Get no results when using two query params. #4270

ameowlia opened this issue Mar 18, 2025 · 1 comment

Comments

@ameowlia
Copy link
Member

ameowlia commented Mar 18, 2025

Setup

I have an app in the middle of a rolling deployment. I want to get the deployment information for this app for the active deployment only.

app_guids query param works

$ cf curl /v3/deployments?app_guids=$(cf app potato --guid) | jq .
{
  "pagination": {
    "total_results": 2,
    "total_pages": 1,
    "first": {
      "href": "https://api.zf9037147.shepherd.lease/v3/deployments?app_guids=dfb90cf9-2af4-4ee1-a0c0-67cebd75433e&page=1&per_page=50"
    },
    "last": {
      "href": "https://api.zf9037147.shepherd.lease/v3/deployments?app_guids=dfb90cf9-2af4-4ee1-a0c0-67cebd75433e&page=1&per_page=50"
    },
    "next": null,
    "previous": null
  },
  "resources": [
    {
      "guid": "2e2ecede-5b02-4b9a-9096-2be171809d5f",
      "created_at": "2025-03-17T16:15:43Z",
      "updated_at": "2025-03-17T20:36:11Z",
      "status": {
        "value": "FINALIZED",
        "reason": "CANCELED",
        "details": {
          "last_successful_healthcheck": "2025-03-17T16:15:48Z",
          "last_status_change": "2025-03-17T20:36:11Z"
        }
      },
      "strategy": "canary",
      "options": {
        "max_in_flight": 1
      },
      "droplet": {
        "guid": "5012babc-a16f-4c86-b80e-c9a129be7cb2"
      },
      "previous_droplet": {
        "guid": "e827e7e8-5829-4b75-9384-5292b4f36190"
      },
      "new_processes": [
        {
          "guid": "5502a786-d29e-4f1a-aa98-8cd7e1e27f14",
          "type": "web"
        }
      ],
      "revision": {
        "guid": "d185c5fb-d762-4736-92a2-be84de58f9dd",
        "version": 2
      },
      "relationships": {
        "app": {
          "data": {
            "guid": "dfb90cf9-2af4-4ee1-a0c0-67cebd75433e"
          }
        }
      },
      "metadata": {
        "labels": {},
        "annotations": {}
      },
      "links": {
        "self": {
          "href": "https://api.zf9037147.shepherd.lease/v3/deployments/2e2ecede-5b02-4b9a-9096-2be171809d5f"
        },
        "app": {
          "href": "https://api.zf9037147.shepherd.lease/v3/apps/dfb90cf9-2af4-4ee1-a0c0-67cebd75433e"
        }
      }
    },
    {
      "guid": "5df110b0-4c92-4ef0-8b4b-d1476b5af997",
      "created_at": "2025-03-17T20:45:53Z",
      "updated_at": "2025-03-17T20:45:57Z",
      "status": {
        "value": "ACTIVE",
        "reason": "PAUSED",
        "details": {
          "last_successful_healthcheck": "2025-03-17T20:45:57Z",
          "last_status_change": "2025-03-17T20:45:57Z"
        }
      },
      "strategy": "canary",
      "options": {
        "max_in_flight": 1
      },
      "droplet": {
        "guid": "f618b417-c6c4-4996-80c0-ac2fbc007fe5"
      },
      "previous_droplet": {
        "guid": "e827e7e8-5829-4b75-9384-5292b4f36190"
      },
      "new_processes": [
        {
          "guid": "bb153bf1-99a4-4512-9ed7-58558ff1fb0a",
          "type": "web"
        }
      ],
      "revision": {
        "guid": "451959d5-b771-423a-b13c-8ed35071914f",
        "version": 3
      },
      "relationships": {
        "app": {
          "data": {
            "guid": "dfb90cf9-2af4-4ee1-a0c0-67cebd75433e"
          }
        }
      },
      "metadata": {
        "labels": {},
        "annotations": {}
      },
      "links": {
        "self": {
          "href": "https://api.zf9037147.shepherd.lease/v3/deployments/5df110b0-4c92-4ef0-8b4b-d1476b5af997"
        },
        "app": {
          "href": "https://api.zf9037147.shepherd.lease/v3/apps/dfb90cf9-2af4-4ee1-a0c0-67cebd75433e"
        },
        "cancel": {
          "href": "https://api.zf9037147.shepherd.lease/v3/deployments/5df110b0-4c92-4ef0-8b4b-d1476b5af997/actions/cancel",
          "method": "POST"
        },
        "continue": {
          "href": "https://api.zf9037147.shepherd.lease/v3/deployments/5df110b0-4c92-4ef0-8b4b-d1476b5af997/actions/continue",
          "method": "POST"
        }
      }
    }
  ]
}

ACTIVE query param works

$ cf curl /v3/deployments?status_values=ACTIVE | jq .
{
  "pagination": {
    "total_results": 1,
    "total_pages": 1,
    "first": {
      "href": "https://api.zf9037147.shepherd.lease/v3/deployments?page=1&per_page=50&status_values=ACTIVE"
    },
    "last": {
      "href": "https://api.zf9037147.shepherd.lease/v3/deployments?page=1&per_page=50&status_values=ACTIVE"
    },
    "next": null,
    "previous": null
  }, 
"resources": [
    {
      "guid": "5df110b0-4c92-4ef0-8b4b-d1476b5af997",
      "created_at": "2025-03-17T20:45:53Z",
      "updated_at": "2025-03-17T20:45:57Z",
      "status": {
        "value": "ACTIVE",
        "reason": "PAUSED",
        "details": {
          "last_successful_healthcheck": "2025-03-17T20:45:57Z",
          "last_status_change": "2025-03-17T20:45:57Z"
        }
      },
      "strategy": "canary",
      "options": {
        "max_in_flight": 1
      },
      "droplet": {
        "guid": "f618b417-c6c4-4996-80c0-ac2fbc007fe5"
      },
      "previous_droplet": {
        "guid": "e827e7e8-5829-4b75-9384-5292b4f36190"
      },
      "new_processes": [
        {
          "guid": "bb153bf1-99a4-4512-9ed7-58558ff1fb0a",
          "type": "web"
        }
      ],
      "revision": {
        "guid": "451959d5-b771-423a-b13c-8ed35071914f",
        "version": 3
      },
      "relationships": {
        "app": {
          "data": {
            "guid": "dfb90cf9-2af4-4ee1-a0c0-67cebd75433e"
          }
        }
      },
      "metadata": {
        "labels": {},
        "annotations": {}
      },
      "links": {
        "self": {
          "href": "https://api.zf9037147.shepherd.lease/v3/deployments/5df110b0-4c92-4ef0-8b4b-d1476b5af997"
        },
        "app": {
          "href": "https://api.zf9037147.shepherd.lease/v3/apps/dfb90cf9-2af4-4ee1-a0c0-67cebd75433e"
        },
        "cancel": {
          "href": "https://api.zf9037147.shepherd.lease/v3/deployments/5df110b0-4c92-4ef0-8b4b-d1476b5af997/actions/cancel",
          "method": "POST"
        },
        "continue": {
          "href": "https://api.zf9037147.shepherd.lease/v3/deployments/5df110b0-4c92-4ef0-8b4b-d1476b5af997/actions/continue",
          "method": "POST"
        }
      }
    }
  ]
}

using both ACTIVE and app_guids query params does not work

$ cf curl /v3/deployments?status_values=ACTIVE?app_guids=$(cf app potato --guid) | jq .
{
  "pagination": {
    "total_results": 0,
    "total_pages": 1,
    "first": {
      "href": "https://api.zf9037147.shepherd.lease/v3/deployments?page=1&per_page=50&status_values=ACTIVE%3Fapp_guids%3Ddfb90cf9-2af4-4ee1-a0c0-67cebd75433e"
    },
    "last": {
      "href": "https://api.zf9037147.shepherd.lease/v3/deployments?page=1&per_page=50&status_values=ACTIVE%3Fapp_guids%3Ddfb90cf9-2af4-4ee1-a0c0-67cebd75433e"
    },
    "next": null,
    "previous": null
  },
  "resources": []
}
@ameowlia
Copy link
Member Author

nvm found my bug :) 🦆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant